quantum_circuit::apply_gate()← Back to Class quantum_circuit
Apply Hermitian gate to the circuit
quantum_circuit::apply_gate(gate, qubit_targets, name = "A")
gate (matrix) — The matrix representation of the gatequbit_targets (array) — The target qubitsname (string, optional) — The gate's name. The default value is "A"
quantum_circuit — Returns the instance of class quantum_circuit
import quantum
qc = quantum_circuit(2)
qc.apply_gate(gate_x, [0])
qc.apply_gate(gate_h & gate_x, [0, 1])