Closed daniel-mills-cqc closed 8 months ago
The following is has 3 X gates, each controlled on the same classical wire. The first and third X gates are turned on, but the middle X gate is off. The expected result would be the 0 state, but the outcome is 1.
from pytket import Circuit from pytket.extensions.quantinuum import QuantinuumBackend, QuantinuumAPIOffline circuit = Circuit(1) control_reg = circuit.add_c_register(name="control", size=1) meas_reg = circuit.add_c_register(name="measure", size=1) circuit.add_c_setreg(1, control_reg) circuit.X(0, condition=control_reg[0]) circuit.add_c_setreg(0, control_reg) circuit.X(0, condition=control_reg[0]) circuit.add_c_setreg(1, control_reg) circuit.X(0, condition=control_reg[0]) circuit.Measure( qubit=circuit.qubits[0], bit=meas_reg[0], ) api_offline = QuantinuumAPIOffline() backend = QuantinuumBackend( device_name="H1-1LE", api_handler = api_offline, ) compiled_circuit = backend.get_compiled_circuit(circuit, optimisation_level=0) result = backend.run_circuit( compiled_circuit, n_shots=100, no_opt=True ) result.get_counts(meas_reg)
Gives
Counter({(1,): 1})
Suspected cause: https://github.com/CQCL/pytket-phir/issues/150
The following is has 3 X gates, each controlled on the same classical wire. The first and third X gates are turned on, but the middle X gate is off. The expected result would be the 0 state, but the outcome is 1.
Gives