laboneq_applications.tasks.multi_qubit_logic
¶
This module defines tasks handling multi-qubit logic and manipulations.
extract_edges_from_qubit_pairs(qpu, qubit_pair_uids, *, tag)
¶
Extracts all edges of type tag in the QPU with the qubit pair passed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qpu
|
QPU
|
The QPU where the topology is stored. |
required |
qubit_pair_uids
|
list[list[str]]
|
The pairs of UIDs for the qubits that will be used as source and target node from the edge, respectively. |
required |
tag
|
str
|
The edge tag to be searched. |
required |
Returns:
| Type | Description |
|---|---|
list[TopologyEdge]
|
The list of extracted edges. |
extract_nodes_from_edges(edges, node_type='all')
¶
Extract the nodes of a list of edges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edges
|
list[TopologyEdge]
|
A list of TopologyEdge instances from which to extract the nodes. |
required |
node_type
|
str
|
The type of nodes to extract: "all": both the source and the target nodes are returned; "source": only the source nodes are returned; "target": only the target nodes are returned. |
'all'
|
Returns:
| Type | Description |
|---|---|
list[QuantumElement] | tuple[list[QuantumElement], list[QuantumElement]]
|
The list of extracted nodes. If "all" is selected as a |
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
ValueError
|
If the |