![]() |
Q2NS dev
ns-3 module
|
Lightweight gate descriptor used by QState backends. More...
#include <q2ns-qgate.h>
Public Member Functions | |
| QGate ()=default | |
| Default constructor. | |
| QGate (QGateKind k, ns3::Time d=ns3::Seconds(0)) | |
| Construct a built-in gate descriptor. | |
| QGateKind | Kind () const |
| Return the gate kind. | |
| ns3::Time | Duration () const |
| Return the optional duration metadata. | |
| const Matrix & | Unitary () const |
| Return the custom unitary matrix. | |
Static Public Member Functions | |
| static QGate | Custom (const Matrix &U, ns3::Time d=ns3::Seconds(0)) |
| Construct a custom gate by copying a matrix. | |
| static QGate | Custom (Matrix &&U, ns3::Time d=ns3::Seconds(0)) |
| Construct a custom gate by moving a matrix. | |
Private Attributes | |
| QGateKind | kind_ {QGateKind::I} |
| Gate kind. | |
| std::shared_ptr< const Matrix > | U_ {} |
| Custom unitary for Custom gates. | |
| ns3::Time | duration_ {ns3::Seconds(0)} |
| Optional duration metadata. | |
Lightweight gate descriptor used by QState backends.
A QGate stores either:
It may also carry an optional duration value for higher-level scheduling or interpretation. QGate itself does not enforce timing behavior.
Definition at line 68 of file q2ns-qgate.h.
|
default |
Default constructor.
|
inlineexplicit |
Construct a built-in gate descriptor.
| k | Built-in gate kind. |
| d | Optional duration metadata. |
Definition at line 80 of file q2ns-qgate.h.
Construct a custom gate by copying a matrix.
| U | Unitary matrix to copy. |
| d | Optional duration metadata. |
Definition at line 120 of file q2ns-qgate.h.
References q2ns::Custom, duration_, kind_, and U_.
Referenced by q2ns::gates::Custom(), and q2ns::gates::Custom().
Construct a custom gate by moving a matrix.
| U | Unitary matrix to move. |
| d | Optional duration metadata. |
Definition at line 136 of file q2ns-qgate.h.
References q2ns::Custom, duration_, kind_, and U_.
|
inline |
Return the optional duration metadata.
Definition at line 94 of file q2ns-qgate.h.
References duration_.
|
inline |
Return the gate kind.
Definition at line 86 of file q2ns-qgate.h.
References kind_.
|
inline |
Return the custom unitary matrix.
This is only valid when Kind() returns QGateKind::Custom.
Definition at line 107 of file q2ns-qgate.h.
References U_.
|
private |
Optional duration metadata.
Definition at line 147 of file q2ns-qgate.h.
Referenced by Custom(), Custom(), and Duration().
|
private |
Gate kind.
Definition at line 145 of file q2ns-qgate.h.
|
private |
Custom unitary for Custom gates.
Definition at line 146 of file q2ns-qgate.h.