17#include "ns3/q2ns-qgate.h"
18#include "ns3/q2ns-types.h"
69 std::shared_ptr<Qubit>
CreateQubit(
const std::string& label =
"");
77 std::shared_ptr<Qubit>
CreateQubit(
const std::shared_ptr<QState>& state,
78 const std::string& label =
"");
84 std::pair<std::shared_ptr<Qubit>, std::shared_ptr<Qubit>>
CreateBellPair();
97 std::shared_ptr<Qubit>
GetQubit(
const std::string& label)
const;
127 void AdoptQubit(
const std::shared_ptr<Qubit>& q);
135 std::shared_ptr<QState>
GetState(
const std::shared_ptr<Qubit>& q)
const;
143 bool Apply(
const QGate& gate,
const std::vector<std::shared_ptr<Qubit>>& qs);
171 std::pair<int, int>
MeasureBell(
const std::shared_ptr<Qubit>& a,
const std::shared_ptr<Qubit>& b);
Lightweight gate descriptor used by QState backends.
Main user-facing per-node API for quantum operations and transmission.
Internal helper owned by a QNode to handle local quantum operations.
int Measure(const std::shared_ptr< Qubit > &qubit, q2ns::Basis basis=q2ns::Basis::Z)
Measure a single, local qubit in the given basis (default Z).
std::pair< int, int > MeasureBell(const std::shared_ptr< Qubit > &a, const std::shared_ptr< Qubit > &b)
Perform a Bell-state measurement on two local qubits.
void AdoptQubit(const std::shared_ptr< Qubit > &q)
Adopt a qubit into this processor's owning node.
std::shared_ptr< QState > GetState(const std::shared_ptr< Qubit > &q) const
Get the current state of the qubit.
std::pair< std::shared_ptr< Qubit >, std::shared_ptr< Qubit > > CreateBellPair()
Create a local Bell pair in |Phi+>
QNode & owner_
Owning QNode.
std::shared_ptr< Qubit > GetQubit(const std::string &label) const
Lookup a local qubit by application label.
const QNode & GetOwnerNode() const
Get owning node.
std::shared_ptr< Qubit > CreateQubit(const std::string &label="")
Create a new local qubit in |0>.
bool Apply(const QGate &gate, const std::vector< std::shared_ptr< Qubit > > &qs)
Apply a gate to one or more local qubits.
QStateRegistry & registry_
Quantum state registry.
std::vector< std::shared_ptr< Qubit > > GetLocalQubits() const
Return the qubits currently located at the owning node.
Internal registry that owns backend states and tracks qubit membership and location.
std::uint64_t QubitId
Stable identifier for a registered qubit handle.
Basis
Measurement basis for single-qubit projective measurement.