Circuits¶
-
class
interlinq.objects.circuit.
Circuit
(q_map: dict, layers: list = [], qubits: list = [])¶ Circuit object which contains information about a quantum circuit.
-
add_layer_to_circuit
(layer)¶ Add a new Layer object to the circuit
- Parameters
layer (Layer) – List of operations to be applied to the system
-
add_new_qubit
(qubit_info: dict)¶ Add a new qubit to the circuit.
- Parameters
qubit_info (dict) – A mapping of the computing hosts ID to the list of new qubits required for the circuit in that host
-
control_gate_info
()¶ Get information about the control gates between two different computing hosts in the circuit. This information includes the operation index in the layer, the associated computing host IDs, control qubit for the control gate.
- Returns
Layer-wise list of control gate information in the circuit
- Return type
(list)
-
create_layers
(qubits: list)¶ Create layers for the circuit from the qubits provided.
- Parameters
qubits (list) – The qubits in the layer.
-
insert_layer
(index: int, layer: interlinq.objects.layer.Layer)¶ Insert a new layer object at a particular index in the circuit.
- Parameters
index (int) – Index at which the new layer should be inserted at
layer (Layer) – new layer object to be inserted
-
property
layers
¶ Get the layers of the circuit.
- Returns
- List of Layer objects, where each layer contains a collection
of gates to be applied on the qubits in the system
- Return type
(list)
-
property
q_map
¶ Get the q_map of the circuit.
- Returns
- A mapping of the computing hosts IDS to the list of qubits
required for the circuit in that host
- Return type
(dict)
-
property
qubits
¶ Get the qubits of the circuit.
- Returns
- List of Qubit objects, where each qubit object stores the
list of operations applied on it
- Return type
(list)
-
total_qubits
()¶ Get the total number of qubits in the circuit.
- Returns
total number of qubits in circuit
- Return type
(int)
-
update_layer
(index: int, layer: interlinq.objects.layer.Layer)¶ Update a layer object at a particular index with a new value.
- Parameters
index (int) – Index at which the new layer should be updated
layer (Layer) – layer object to be updated
-
update_qubits
(qubits: list)¶ Update qubits in the circuit.
- Parameters
qubits (list) – List of Qubit objects, where each qubit object stores the list of operations applied on it
-