sys-sage
|
Represents a coupling (connectivity) relation between two or more qubits/components. More...
#include <CouplingMap.hpp>
Public Member Functions | |
CouplingMap (Qubit *q1, Qubit *q2) | |
Constructs a CouplingMap between two qubits. | |
CouplingMap (const std::vector< Component * > &components, int _id=0, bool _ordered=true) | |
Constructs a CouplingMap between a set of components. | |
void | SetFidelity (double _fidelity) |
Sets the fidelity value for this coupling relation. | |
double | GetFidelity () const |
Gets the fidelity value for this coupling relation. | |
void | Delete () override |
Deletes this coupling relation and performs any necessary cleanup. Overrides the base Relation::Delete(). | |
![]() | |
Relation (const std::vector< Component * > &components, int _id=0, bool _ordered=true) | |
Construct a new Relation object. | |
void | SetId (int _id) |
Sets the id of the relationship. | |
int | GetId () const |
Gets the id of the relationship. | |
RelationType::type | GetType () const |
Get the type of the relation. | |
std::string | GetTypeStr () const |
Return a human-readable name of the relation type. | |
bool | IsOrdered () const |
Check if this relation treats component order as meaningful. | |
bool | ContainsComponent (Component *c) const |
Check whether the given component is part of this relation. | |
Component * | GetComponent (int index) const |
Get the component at a specific position. | |
const std::vector< Component * > & | GetComponents () const |
Access the list of components. | |
virtual void | Print () const |
Virtual function to print the details of the relationship. | |
void | AddComponent (Component *c) |
Add a new component to the relation. | |
int | UpdateComponent (int index, Component *_new_component) |
Replace a component at the given index. | |
int | UpdateComponent (Component *_old_component, Component *_new_component) |
Replace the first occurrence of a given component. | |
~Relation ()=default | |
Destructor for the Relation class. | |
Additional Inherited Members | |
![]() | |
std::map< std::string, void * > | attrib |
![]() | |
bool | ordered |
Whether order in the component list is meaningful. | |
int | id |
The id of the relationship. | |
RelationType::type | type |
The type of the relationship (see RelationType::type). | |
std::vector< Component * > | components |
A vector of components associated with the relationship. | |
Represents a coupling (connectivity) relation between two or more qubits/components.
This class is used to describe the physical or logical connectivity between qubits in a quantum device, typically as part of the quantum hardware abstraction in sys-sage. It inherits from Relation and can represent both directed and undirected couplings, as well as additional properties such as fidelity.
CouplingMap objects are essential for describing which qubits can interact directly (e.g., for two-qubit gates) and for mapping quantum circuits to hardware. The class supports both pairwise and multi-component couplings.
Constructs a CouplingMap between two qubits.
q1 | Pointer to the first qubit. |
q2 | Pointer to the second qubit. |
This constructor is typically used for pairwise couplings in quantum hardware.
sys_sage::CouplingMap::CouplingMap | ( | const std::vector< Component * > & | components, |
int | _id = 0, | ||
bool | _ordered = true ) |
Constructs a CouplingMap between a set of components.
components | Vector of pointers to components (e.g., qubits) involved in the coupling. |
_id | Optional relation ID (default 0). |
_ordered | Whether the coupling is ordered/directed (default true). |
This constructor allows for more general coupling relations, including multi-qubit couplings.
|
overridevirtual |
Deletes this coupling relation and performs any necessary cleanup. Overrides the base Relation::Delete().
Reimplemented from sys_sage::Relation.
double sys_sage::CouplingMap::GetFidelity | ( | ) | const |
Gets the fidelity value for this coupling relation.
void sys_sage::CouplingMap::SetFidelity | ( | double | _fidelity | ) |
Sets the fidelity value for this coupling relation.
_fidelity | The fidelity (typically between 0 and 1). |
Fidelity can be used to represent the quality or reliability of the coupling (e.g., gate fidelity).