![]() |
Q2NS dev
ns-3 module
|
Shared enums, ids, locations, matrices, and gate helpers used across Q2NS. More...
Classes | |
| class | q2ns::QGate |
| Lightweight gate descriptor used by QState backends. More... | |
| struct | q2ns::Location |
| Current tracked location of a qubit. More... | |
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::QGateKind { q2ns::QGateKind::Custom , q2ns::QGateKind::I , q2ns::QGateKind::X , q2ns::QGateKind::Y , q2ns::QGateKind::Z , q2ns::QGateKind::H , q2ns::QGateKind::S , q2ns::QGateKind::SDG , q2ns::QGateKind::CNOT , q2ns::QGateKind::CZ , q2ns::QGateKind::SWAP } |
| Enumerates built-in gate kinds. More... | |
| 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< QStateBackend > | q2ns::AllQStateBackends () |
| Return all supported backend enum values. | |
| Location | q2ns::MakeUnsetLocation () |
| Construct an Unset location value. | |
Shared enums, ids, locations, matrices, and gate helpers used across Q2NS.
| using q2ns::Complex = typedef std::complex<double> |
Complex scalar type used by matrix-based backends.
Definition at line 37 of file q2ns-types.h.
| using q2ns::Index = typedef std::size_t |
Generic qubit index type within a backend state.
Definition at line 49 of file q2ns-types.h.
| using q2ns::Matrix = typedef Eigen::MatrixXcd |
Dynamic complex matrix type used for custom gates and matrix-based states.
Definition at line 43 of file q2ns-types.h.
| using q2ns::QMapInstance = typedef std::function<void(QNode&, std::shared_ptr<Qubit>&)> |
Per-transmission quantum map callable applied to a received qubit.
QMapInstance objects are typically produced by QMap::Sample() during channel transmission and later executed at the receiving node after the qubit becomes local there.
Definition at line 71 of file q2ns-types.h.
| using q2ns::QubitId = typedef std::uint64_t |
Stable identifier for a registered qubit handle.
Definition at line 61 of file q2ns-types.h.
| using q2ns::RecvCallback = typedef ns3::Callback<void, std::shared_ptr<Qubit> > |
Callback invoked when a qubit is successfully received at a node.
The callback is executed after the qubit has been adopted by the receiving node and any QMapInstance associated with the transmission has been applied.
| qubit | Received qubit handle. |
Definition at line 82 of file q2ns-types.h.
| using q2ns::StateId = typedef std::uint64_t |
Stable identifier for a registered backend state.
Definition at line 55 of file q2ns-types.h.
|
strong |
Measurement basis for single-qubit projective measurement.
| Enumerator | |
|---|---|
| Z | |
| X | |
| Y | |
Definition at line 88 of file q2ns-types.h.
|
strong |
Kind of simulated qubit location.
| Enumerator | |
|---|---|
| Node | Qubit is local to a node identified by node id. |
| Channel | Qubit is in transit on a channel identified by channel id. |
| Lost | Qubit was lost and is no longer accessible. |
| Unset | Qubit location has not yet been assigned. |
Definition at line 124 of file q2ns-types.h.
|
strong |
Enumerates built-in gate kinds.
Custom represents a caller-supplied unitary matrix. All other values refer to predefined gates with built-in matrix definitions.
| Enumerator | |
|---|---|
| Custom | Caller-supplied matrix. |
| I | |
| X | |
| Y | |
| Z | |
| H | |
| S | |
| SDG | |
| CNOT | |
| CZ | |
| SWAP | |
Definition at line 37 of file q2ns-qgate.h.
|
strong |
Backend family used when creating new quantum states.
| Enumerator | |
|---|---|
| Ket | State-vector backend. |
| DM | Density-matrix backend. |
| Stab | Stabilizer backend. |
Definition at line 94 of file q2ns-types.h.
|
inline |
Return all supported backend enum values.
Definition at line 116 of file q2ns-types.h.
References q2ns::DM, q2ns::Ket, and q2ns::Stab.
| QStateBackend q2ns::BackendFromString | ( | std::string_view | s | ) |
Convert a backend name string to a QStateBackend enum value.
Parse a backend name string.
Unrecognized names fall back to QStateBackend::Ket.
| s | Backend name string. |
Definition at line 29 of file q2ns-qstate-registry.cc.
References q2ns::DM, q2ns::Ket, and q2ns::Stab.
Referenced by q2ns::NetController::SetQStateBackend().
|
inline |
Construct an Unset location value.
Definition at line 156 of file q2ns-types.h.
References q2ns::Location::type, and q2ns::Unset.
Referenced by q2ns::QStateRegistry::GetLocation(), q2ns::QStateRegistry::GetLocation(), and q2ns::QStateRegistry::Register().