CircuitGates
QuICT.core.utils.CircuitGates ¶
Source code in QuICT/core/utils/circuit_gate.py
gate_qubits_count
property
¶
The number of quantum gate with target gate type.
append ¶
Add a quantum gate to Circuit's gate mapping.
Parameters:
-
gate((BasicGate, Operator)) –The quantum gate.
-
qidxes(list) –The qubit indexes.
copy ¶
decomposition ¶
Decomposition the CompositeGate or BasicGate which has build_gate function.
Source code in QuICT/core/utils/circuit_gate.py
depth ¶
Return the depth of current
Source code in QuICT/core/utils/circuit_gate.py
extend ¶
Add a CompositeGate to Circuit's gate mapping.
Parameters:
-
gates(CompositeGate) –The CompositeGate.
-
qidxes(list) –The qubit indexes.
Source code in QuICT/core/utils/circuit_gate.py
find_last_layer_gates ¶
Return the last layer gates with given qubits.
Parameters:
-
qubits(list) –The indexes of qubits.
-
all_contains(bool, default:False) –Whether the gate is in the last layer exactly.
Source code in QuICT/core/utils/circuit_gate.py
flatten ¶
Get the list of Quantum Gates, flat all the CompositeGate in Circuit.
Source code in QuICT/core/utils/circuit_gate.py
flatten_by_level ¶
Flatten gates in the circuit by level of decomposition.
Source code in QuICT/core/utils/circuit_gate.py
gate_analysis ¶
Update Circuit property by add/pop quantum gate.
Source code in QuICT/core/utils/circuit_gate.py
gates ¶
gates_count_by_type ¶
get_target_gates ¶
Return the BasicGate with target qubits and depth.
Parameters:
-
qubits(list) –The indexes of qubits
-
depth(int) –The target depth
-
no_copy(bool, default:True) –Whether copy target gate.
Source code in QuICT/core/utils/circuit_gate.py
init_pargs ¶
Initialize the trainable parameters.
Parameters:
-
symbols(list) –The symbols that needs to be assigned values.
-
values(Union[list, ndarray]) –The values to be assigned.
Source code in QuICT/core/utils/circuit_gate.py
insert ¶
Insert the BasicGate/CompositeGate into gate_list with given index.
Source code in QuICT/core/utils/circuit_gate.py
insert_by_position ¶
Insert a BasicGate / CompositeGate.
Parameters:
-
gate(BasicGate) –The quantum gate.
-
depth(int, default:-1) –the target depth.
Source code in QuICT/core/utils/circuit_gate.py
pop ¶
pop_by_position ¶
Pop the gate with target qubits and depth.
Parameters:
-
qubits(list) –The target qubit indexes.
-
depth(int, default:-1) –The target depth.
Source code in QuICT/core/utils/circuit_gate.py
remap ¶
Remapping the gates's qubit indexes.
Source code in QuICT/core/utils/circuit_gate.py
reset ¶
split ¶
Split the Circuit/CompositeGate by qubits or depth.
Parameters:
-
qubits(List, default:None) –The qubit indexes for one of split CompositeGate.
-
depth(Union[int, List], default:None) –The split depth for current CompositeGate, support split by different
-
width(int, default:None) –The width of current Circuit/CompositeGate.
Source code in QuICT/core/utils/circuit_gate.py
split_by_depth ¶
Split Circuit/CompositeGate by depth.
Source code in QuICT/core/utils/circuit_gate.py
split_by_qubits ¶
Split Circuit/CompositeGate by qubits.