def test_add_same_gate_multiple_time(self): from qulacs import QuantumCircuit, QuantumState from qulacs.gate import X, DepolarizingNoise, DephasingNoise, Probabilistic, RX state = QuantumState(1) circuit = QuantumCircuit(1) noise = DepolarizingNoise(0, 0) circuit.add_gate(noise) circuit.add_gate(noise.copy()) circuit.add_gate(DephasingNoise(0, 0)) circuit.add_gate(Probabilistic([0.1], [RX(0, 0)])) gate = RX(0, 0) circuit.add_gate(gate) circuit.add_gate(gate) circuit.add_gate(gate) circuit.add_gate(gate) circuit.add_gate(gate) del gate circuit.update_quantum_state(state) circuit.update_quantum_state(state) circuit.update_quantum_state(state) circuit.update_quantum_state(state) circuit.update_quantum_state(state) circuit.update_quantum_state(state) circuit.update_quantum_state(state) circuit.to_string() del circuit del state
def test_add_gate(self): from qulacs import QuantumCircuit from qulacs.gate import X circuit = QuantumCircuit(1) gate = X(0) circuit.add_gate(gate) del gate s = circuit.to_string() del circuit