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

Represents a quantum gate in a quantum circuit. More...

#include <QuantumGate.hpp>

Inheritance diagram for sys_sage::QuantumGate:
sys_sage::Relation

Public Member Functions

 QuantumGate ()
 Default constructor for QuantumGate.
 
 QuantumGate (size_t _gate_size)
 Constructor that initializes a quantum gate with a specified size.
 
 QuantumGate (size_t _gate_size, std::string _name, double _fidelity, std::string _unitary)
 Constructor that initializes a quantum gate with specific properties.
 
 QuantumGate (size_t _gate_size, const std::vector< Qubit * > &_qubits)
 Constructor that initializes a quantum gate with a list of qubits.
 
 QuantumGate (size_t _gate_size, const std::vector< Qubit * > &_qubits, std::string _name, double _fidelity, std::string _unitary)
 Constructor that initializes a quantum gate with detailed properties and qubits.
 
 QuantumGate (const std::vector< Component * > &components, int _id=0, bool _ordered=true, size_t _gate_size=0, std::string _name="", int _gate_length=0, QuantumGateType::type _gate_type=QuantumGateType::Unknown, double _fidelity=0, std::string _unitary="")
 Constructor for advanced initialization, including all properties and components.
 
void SetGateProperties (std::string _name, double _fidelity, std::string _unitary)
 Sets the properties of the quantum gate.
 
void SetGateCouplingMap (std::vector< std::vector< Qubit * > > _coupling_mapping)
 Sets the coupling map for the quantum gate.
 
void SetAdditionalProperties ()
 Sets additional properties for the quantum gate.
 
void SetQuantumGateType ()
 Sets the type of the quantum gate.
 
QuantumGateType::type GetQuantumGateType () const
 Gets the type of the quantum gate.
 
double GetFidelity () const
 Gets the fidelity of the quantum gate.
 
size_t GetGateSize () const
 Gets the size of the quantum gate.
 
void SetGateSize (size_t gateSize)
 Sets the size of the quantum gate.
 
void SetGateLength (int GateLength)
 Sets the length of the quantum gate operation (e.g., in time or circuit depth).
 
const std::string & GetUnitary () const
 Gets the unitary matrix of the quantum gate.
 
void SetName (std::string _name)
 Sets the name of the relationship.
 
std::string GetName () const
 Gets the name of the relationship.
 
void Print () const override
 Prints the details of the quantum gate.
 
- 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.
 
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.
 
virtual void Delete ()
 Virtual function to delete the relation.
 
 ~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 quantum gate in a quantum circuit.

This class extends the Relation class to model quantum gates. It includes various properties specific to quantum gates, such as gate size, fidelity, and unitary matrix. The class also handles the coupling map and additional properties related to quantum gate operations. QuantumGate objects can represent both single- and multi-qubit gates, and are used to describe the logical operations that can be performed on a quantum backend.

Constructor & Destructor Documentation

◆ QuantumGate() [1/6]

sys_sage::QuantumGate::QuantumGate ( )

Default constructor for QuantumGate.

Initializes a quantum gate with default properties.

◆ QuantumGate() [2/6]

sys_sage::QuantumGate::QuantumGate ( size_t _gate_size)

Constructor that initializes a quantum gate with a specified size.

Parameters
_gate_sizeThe number of qubits this gate operates on.

◆ QuantumGate() [3/6]

sys_sage::QuantumGate::QuantumGate ( size_t _gate_size,
std::string _name,
double _fidelity,
std::string _unitary )

Constructor that initializes a quantum gate with specific properties.

Parameters
_gate_sizeThe number of qubits this gate operates on.
_nameThe name of the quantum gate.
_fidelityThe fidelity of the quantum gate.
_unitaryThe unitary matrix representing the quantum gate operation.

◆ QuantumGate() [4/6]

sys_sage::QuantumGate::QuantumGate ( size_t _gate_size,
const std::vector< Qubit * > & _qubits )

Constructor that initializes a quantum gate with a list of qubits.

Parameters
_gate_sizeThe number of qubits this gate operates on.
_qubitsA vector of pointers to Qubit objects that the gate operates on.

◆ QuantumGate() [5/6]

sys_sage::QuantumGate::QuantumGate ( size_t _gate_size,
const std::vector< Qubit * > & _qubits,
std::string _name,
double _fidelity,
std::string _unitary )

Constructor that initializes a quantum gate with detailed properties and qubits.

Parameters
_gate_sizeThe number of qubits this gate operates on.
_qubitsA vector of pointers to Qubit objects that the gate operates on.
_nameThe name of the quantum gate.
_fidelityThe fidelity of the quantum gate.
_unitaryThe unitary matrix representing the quantum gate operation.

◆ QuantumGate() [6/6]

sys_sage::QuantumGate::QuantumGate ( const std::vector< Component * > & components,
int _id = 0,
bool _ordered = true,
size_t _gate_size = 0,
std::string _name = "",
int _gate_length = 0,
QuantumGateType::type _gate_type = QuantumGateType::Unknown,
double _fidelity = 0,
std::string _unitary = "" )

Constructor for advanced initialization, including all properties and components.

Parameters
componentsVector of pointers to components (qubits) the gate acts on.
_idOptional relation ID (default 0).
_orderedWhether the gate is ordered (default true).
_gate_sizeThe number of qubits this gate operates on.
_nameThe name of the quantum gate.
_gate_lengthThe length of the gate operation (e.g., in time or circuit depth).
_gate_typeThe type of the quantum gate (see QuantumGateType::type).
_fidelityThe fidelity of the quantum gate.
_unitaryThe unitary matrix representing the quantum gate operation.

Member Function Documentation

◆ GetFidelity()

double sys_sage::QuantumGate::GetFidelity ( ) const

Gets the fidelity of the quantum gate.

Returns
The fidelity of the quantum gate.

◆ GetGateSize()

size_t sys_sage::QuantumGate::GetGateSize ( ) const

Gets the size of the quantum gate.

Returns
The number of qubits this gate operates on.

◆ GetName()

std::string sys_sage::QuantumGate::GetName ( ) const

Gets the name of the relationship.

Returns
The current name of the relationship.

◆ GetQuantumGateType()

sys_sage::QuantumGateType::type sys_sage::QuantumGate::GetQuantumGateType ( ) const

Gets the type of the quantum gate.

Returns
The type identifier for the quantum gate.

◆ GetUnitary()

const std::string & sys_sage::QuantumGate::GetUnitary ( ) const

Gets the unitary matrix of the quantum gate.

Returns
A string representing the unitary matrix of the quantum gate.

◆ Print()

void sys_sage::QuantumGate::Print ( ) const
overridevirtual

Prints the details of the quantum gate.

This method overrides the Print function in the Relation class to provide specific printing behavior for quantum gates.

Reimplemented from sys_sage::Relation.

◆ SetAdditionalProperties()

void sys_sage::QuantumGate::SetAdditionalProperties ( )

Sets additional properties for the quantum gate.

This function allows setting properties that are not part of the core quantum gate attributes.

◆ SetGateCouplingMap()

void sys_sage::QuantumGate::SetGateCouplingMap ( std::vector< std::vector< Qubit * > > _coupling_mapping)

Sets the coupling map for the quantum gate.

Parameters
_coupling_mappingA vector of vectors of pointers to Qubit objects representing the coupling map.

◆ SetGateLength()

void sys_sage::QuantumGate::SetGateLength ( int GateLength)

Sets the length of the quantum gate operation (e.g., in time or circuit depth).

Parameters
GateLengthThe length of the gate operation.

◆ SetGateProperties()

void sys_sage::QuantumGate::SetGateProperties ( std::string _name,
double _fidelity,
std::string _unitary )

Sets the properties of the quantum gate.

Parameters
_nameThe name of the quantum gate.
_fidelityThe fidelity of the quantum gate.
_unitaryThe unitary matrix representing the quantum gate operation.

◆ SetGateSize()

void sys_sage::QuantumGate::SetGateSize ( size_t gateSize)

Sets the size of the quantum gate.

Parameters
gateSizeThe number of qubits this gate operates on.

◆ SetName()

void sys_sage::QuantumGate::SetName ( std::string _name)

Sets the name of the relationship.

Parameters
_nameThe name of the relationship to set.

◆ SetQuantumGateType()

void sys_sage::QuantumGate::SetQuantumGateType ( )

Sets the type of the quantum gate.

Sets the specific type for quantum gates.


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