|
| QuantumBackend (int _id=0, std::string _name="QuantumBackend") |
|
| QuantumBackend (Component *parent, int _id=0, std::string _name="QuantumBackend") |
|
void | SetNumQubits (int _num_qubits) |
| Sets the number of qubits in the quantum backend.
|
|
int | GetNumQubits () const |
| Gets the number of qubits in the quantum backend.
|
|
void | addGate (QuantumGate *gate) |
| Adds a quantum gate to the quantum backend.
|
|
std::vector< QuantumGate * > | GetGatesBySize (size_t _gate_size) const |
| Gets the quantum gates by their size.
|
|
std::vector< QuantumGate * > | GetGatesByType (size_t _gate_type) const |
| Gets the quantum gates by their type.
|
|
std::vector< QuantumGate * > | GetAllGateTypes () const |
| Gets all types of quantum gates in the quantum backend.
|
|
int | GetNumberofGates () const |
| Gets the number of quantum gates in the quantum backend.
|
|
std::vector< Qubit * > | GetAllQubits () |
| Gets all qubits in the quantum backend.
|
|
void | RefreshTopology (std::set< int > qubit_indices) |
| Refreshes the topology of the quantum backend.
|
|
| Component (int _id=0, std::string _name="unknown") |
| Generic Component constructor (no automatic insertion in the Component Tree). Usually one of the derived subclasses for different Component Types will be created, not this one.
|
|
| Component (Component *parent, int _id=0, std::string _name="unknown") |
| Generic Component constructor with insertion into the Component Tree as the parent's child. Usually one of the derived subclasses for different Component Types will be created.
|
|
void | InsertChild (Component *child) |
| Inserts a child component to this component (in the Component Tree). The child pointer will be inserted at the end of the children vector.
|
|
int | InsertBetweenParentAndChild (Component *parent, Component *child, bool alreadyParentsChild) |
| Inserts this component between a parent and one of its children. The parent component remains the parent, this Component becomes a new child of the parent, and the specified child becomes this component's child.
|
|
int | InsertBetweenParentAndChildren (Component *parent, std::vector< Component * > children, bool alreadyParentsChild) |
| Inserts this component between a parent and a (subset of) its children. The parent component remains parent, this Component becomes a new child, and the children become parent's grandchildren.
|
|
int | RemoveChild (Component *child) |
| Removes the passed component from the list of children, without completely deleting (and deallocating) the child itself.
|
|
void | SetParent (Component *parent) |
| Set a parent to the component. This is usually used when inserting a component in the tree (by calling InsertChild on the parent, and calling SetParent on the child).
|
|
void | PrintSubtree () const |
| Prints the whole subtree of this component (including the component itself) to stdout. The tree is printed in DFS order, so that the hierarchy can be easily seen. Each child is indented by " ". For each component in the subtree, the following is printed: "<string component type> (name <name>) id <id> - children: <num children>
|
|
void | PrintAllDataPathsInSubtree () |
| Prints all DataPaths that go from or to components in the subtree.
|
|
void | PrintAllRelationsInSubtree (RelationType::type RelationType=RelationType::Any) |
| Prints all Relations in the subtree.
|
|
const std::string & | GetName () const |
| Returns name of the component.
|
|
void | SetName (std::string _name) |
| Sets name of the component.
|
|
int | GetId () const |
| Returns id of the component.
|
|
sys_sage::ComponentType::type | GetComponentType () const |
| Returns component type of the component. The component type denotes which class the instance is (often stored as Component*, even though they are a member of one of the child classes).
|
|
std::string | GetComponentTypeStr () const |
| Returns component type as a human-readable string, as defined in ComponentType::names.
|
|
const std::vector< Component * > & | GetChildren () const |
| Returns a const reference to std::vector containing all children of the component (empty vector if no children).
|
|
Component * | GetParent () const |
| Returns Component pointer to parent (or NULL if this component is the root)
|
|
Component * | GetChild (int _id) const |
| Retrieve a Component* to a child with child.id=_id. Identical to GetChildById
Should there be more children with the same id, the first match will be retrieved (i.e. the one with lower index in the children array.)
|
|
Component * | GetChildById (int _id) const |
| Retrieve a Component* to a child with child.id=_id. Should there be more children with the same id, the first match will be retrieved (i.e. the one with lower index in the children array.)
|
|
Component * | GetChildByType (ComponentType::type _componentType) const |
| Retrieve a Component* to a child matching the given component type. Should there be more children with the same type, the first match will be retrieved (i.e. the one with lower index in the children array.)
|
|
std::vector< Component * > | GetAllChildrenByType (ComponentType::type _componentType) const |
| Searches for all children matching the given component type.
|
|
void | GetAllChildrenByType (std::vector< Component * > *_outArray, ComponentType::type _componentType) const |
| Searches for all the children matching the given component type.
|
|
Component * | GetSubcomponentById (int _id, ComponentType::type _componentType) |
| Searches the subtree to find a component with a matching id and componentType, i.e. looks for a certain component with a matching ID. The search is a DFS. The search starts with the calling component.
|
|
void | GetAllSubcomponentsByType (std::vector< Component * > *outArray, ComponentType::type _componentType) |
| Searches for all the subcomponents (children, their children and so on) matching the given component type.
|
|
std::vector< Component * > | GetAllSubcomponentsByType (ComponentType::type _componentType) |
| Searches for all the subcomponents (children, their children and so on) matching the given component type.
|
|
int | CountAllSubcomponents () const |
| Counts number of subcomponents (children, grandchildren, etc.).
|
|
int | CountAllSubcomponentsByType (ComponentType::type _componentType) const |
| Counts number of subcomponents (children, their children and so on) matching the requested component type.
|
|
int | CountAllChildrenByType (ComponentType::type _componentType) const |
| Counts number of children matching the requested component type.
|
|
Component * | GetAncestorByType (ComponentType::type _componentType) |
| Moves up the tree until a parent of the given type is found.
|
|
int | GetSubtreeDepth () const |
| Retrieves maximal distance to a leaf (i.e. the depth of the subtree). 0=leaf, 1=children are leaves, 2=at most children's children are leaves .....
|
|
Component * | GetNthAncestor (int n) |
| Retrieves Nth ancestor, which resides N levels above. E.g. if n=1, the parent is retrieved; if n=2, the grandparent is retrieved and so on.
|
|
void | GetNthDescendents (std::vector< Component * > *outArray, int depth) |
| Retrieves a std::vector of Component pointers, which reside 'depth' levels deeper. The tree is traversed in order as the children are stored in std::vector children. E.g. if depth=1, only children of the current are retrieved; if depth=2, only children of the children are retrieved..
|
|
std::vector< Component * > | GetNthDescendents (int depth) |
| Retrieves a std::vector of Component pointers, which reside 'depth' levels deeper. The tree is traversed in order as the children are stored in the std::vector. E.g. if depth=1, only children of the current are retrieved; if depth=2, only children of the children are retrieved..
|
|
void | GetSubcomponentsByType (std::vector< Component * > *outArray, int componentType) |
| Retrieves a std::vector of Component pointers, which reside in the subtree and have a matching type. The tree is traversed DFS in order as the children are stored in each std::vector children.
|
|
std::vector< Component * > | GetSubcomponentsByType (ComponentType::type _componentType) |
| Retrieves a std::vector of Component pointers, which reside in the subtree and have a matching type. The tree is traversed DFS in order as the children are stored in the std::vector.
|
|
void | GetComponentsInSubtree (std::vector< Component * > *outArray) |
| Retrieves a std::vector of Component pointers, which form the subtree (current node and all the subcomponents) of this.
|
|
std::vector< Component * > | GetComponentsInSubtree () |
| Retrieves a std::vector of Component pointers, which form the subtree (current node and all the subcomponents) of this.
|
|
const std::vector< Relation * > & | GetRelations (RelationType::type relationType) const |
| Returns a (const) reference to the internal vector of relations for a given type.
|
|
std::vector< Relation * > | GetAllRelationsBy (RelationType::type relationType=RelationType::Any, int thisComponentPosition=-1) const |
| Returns a newly-constructed vector of all relations of a given type and position.
|
|
DataPath * | GetDataPathByType (DataPathType::type dp_type, DataPathDirection::type direction=DataPathDirection::Any) const |
| Retrieves a DataPath* from the list of this component's data paths with matching DataPathType and DataPathDirection. The first match is returned.
|
|
void | GetAllDataPaths (std::vector< DataPath * > *outDpArr, DataPathType::type dp_type=DataPathType::Any, DataPathDirection::type direction=DataPathDirection::Any) const |
| Retrieves all DataPath* from the list of this component's data paths with matching type and orientation. Results are returned in std::vector<DataPath*>* outDpArr, where first the matching data paths in dp_outgoing are pushed back, then the ones in dp_incoming.
|
|
std::vector< DataPath * > | GetAllDataPaths (DataPathType::type dp_type=DataPathType::Any, DataPathDirection::type direction=DataPathDirection::Any) const |
| Retrieves all DataPath* from the list of this component's data paths with matching type and orientation/direction. Results are returned in a std::vector<DataPath*>*.
|
|
int | CheckComponentTreeConsistency () const |
| Checks the consistency of the component tree starting from this component.
|
|
int | GetTopologySize (unsigned *out_component_size, unsigned *out_dataPathSize) const |
| Calculates approximate memory footprint of the subtree of this element (including the relevant Relations).
|
|
int | GetDepth (bool refresh) |
| Retrieves the depth (level) of a component in the topology.
|
|
void | DeleteRelation (Relation *r) |
| Deletes a Relation from this component as well as the Relation itself.
|
|
void | DeleteDataPath (DataPath *dp) |
| Deletes and deallocates the DataPath pointer from the list of outgoing/incoming DataPaths.
|
|
void | DeleteAllRelations (RelationType::type relationType=RelationType::Any) |
| Deletes all relations of this component (optionally filtered by type).
|
|
void | DeleteAllDataPaths () |
| Deletes all DataPaths of this component.
|
|
void | DeleteSubtree () const |
|
void | Delete (bool withSubtree=true) |
| Deletes a component, its children (if withSubtree = true), and all associated Relations. If only the component itself is deleted, its children are inserted into its parent's children list.
|
|
Represents a quantum backend device (e.g., quantum processor or simulator).
Inherits from Component and provides a unified abstraction for quantum hardware backends. This class manages qubits, quantum gates, and their relations, and supports integration with external quantum device interfaces (e.g., QDMI). It is designed to be extensible for new quantum architectures and data sources.