sys-sage
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sys_sage::CouplingMap Class Reference

Represents a coupling (connectivity) relation between two or more qubits/components. More...

#include <CouplingMap.hpp>

Inheritance diagram for sys_sage::CouplingMap:
sys_sage::Relation

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().
 
- Public Member Functions inherited from sys_sage::Relation
 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.
 
ComponentGetComponent (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

- Public Attributes inherited from sys_sage::Relation
std::map< std::string, void * > attrib
 
- Protected Attributes inherited from sys_sage::Relation
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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CouplingMap() [1/2]

sys_sage::CouplingMap::CouplingMap ( Qubit * q1,
Qubit * q2 )

Constructs a CouplingMap between two qubits.

Parameters
q1Pointer to the first qubit.
q2Pointer to the second qubit.

This constructor is typically used for pairwise couplings in quantum hardware.

◆ CouplingMap() [2/2]

sys_sage::CouplingMap::CouplingMap ( const std::vector< Component * > & components,
int _id = 0,
bool _ordered = true )

Constructs a CouplingMap between a set of components.

Parameters
componentsVector of pointers to components (e.g., qubits) involved in the coupling.
_idOptional relation ID (default 0).
_orderedWhether the coupling is ordered/directed (default true).

This constructor allows for more general coupling relations, including multi-qubit couplings.

Member Function Documentation

◆ Delete()

void sys_sage::CouplingMap::Delete ( )
overridevirtual

Deletes this coupling relation and performs any necessary cleanup. Overrides the base Relation::Delete().

Reimplemented from sys_sage::Relation.

◆ GetFidelity()

double sys_sage::CouplingMap::GetFidelity ( ) const

Gets the fidelity value for this coupling relation.

Returns
The fidelity (typically between 0 and 1).

◆ SetFidelity()

void sys_sage::CouplingMap::SetFidelity ( double _fidelity)

Sets the fidelity value for this coupling relation.

Parameters
_fidelityThe fidelity (typically between 0 and 1).

Fidelity can be used to represent the quality or reliability of the coupling (e.g., gate fidelity).


The documentation for this class was generated from the following files: