Q2NS dev
ns-3 module
Loading...
Searching...
No Matches
q2ns-types.h File Reference

Common types, enums, and small helpers shared across q2ns. More...

#include <Eigen/Dense>
#include <complex>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <memory>
#include <string_view>
#include <vector>
#include "ns3/callback.h"
Include dependency graph for q2ns-types.h:

Go to the source code of this file.

Classes

struct  q2ns::Location
 Current tracked location of a qubit. More...
 

Namespaces

namespace  q2ns
 

Typedefs

using q2ns::Complex = std::complex< double >
 Complex scalar type used by matrix-based backends.
 
using q2ns::Matrix = Eigen::MatrixXcd
 Dynamic complex matrix type used for custom gates and matrix-based states.
 
using q2ns::Index = std::size_t
 Generic qubit index type within a backend state.
 
using q2ns::StateId = std::uint64_t
 Stable identifier for a registered backend state.
 
using q2ns::QubitId = std::uint64_t
 Stable identifier for a registered qubit handle.
 
using q2ns::QMapInstance = std::function< void(QNode &, std::shared_ptr< Qubit > &)>
 Per-transmission quantum map callable applied to a received qubit.
 
using q2ns::RecvCallback = ns3::Callback< void, std::shared_ptr< Qubit > >
 Callback invoked when a qubit is successfully received at a node.
 

Enumerations

enum class  q2ns::Basis { q2ns::Basis::Z , q2ns::Basis::X , q2ns::Basis::Y }
 Measurement basis for single-qubit projective measurement. More...
 
enum class  q2ns::QStateBackend { q2ns::QStateBackend::Ket , q2ns::QStateBackend::DM , q2ns::QStateBackend::Stab }
 Backend family used when creating new quantum states. More...
 
enum class  q2ns::LocationType { q2ns::LocationType::Node , q2ns::LocationType::Channel , q2ns::LocationType::Lost , q2ns::LocationType::Unset }
 Kind of simulated qubit location. More...
 

Functions

QStateBackend q2ns::BackendFromString (std::string_view s)
 Convert a backend name string to a QStateBackend enum value.
 
std::vector< QStateBackendq2ns::AllQStateBackends ()
 Return all supported backend enum values.
 
Location q2ns::MakeUnsetLocation ()
 Construct an Unset location value.
 

Detailed Description

Common types, enums, and small helpers shared across q2ns.

Definition in file q2ns-types.h.