1

I have code built in Qiskit that runs and provides the expected output on the Aer simulator. The bit ordering of the output is little-endian based on the order that the classical registers are added to the circuit.

My research requires use of Qulacs backend as a simulator and I'm trying to use pytket to transform the circuit. My issue is that the output doesn't change when the qubit or classical bit ordering input changes and I can't tell which bit in readout corresponds to the input bits. The code I'm using for the transform is below where circ is the circuit that runs in Qiskit.

from pytket.extensions.qiskit import qiskit_to_tk
from pytket.circuit import BasisOrder
from pytket.extensions.qulacs import QulacsBackend

circ = QuantumCircuit(Flag_reg, anc_reg, state_reg, classical_flag, classical_anc, classical_state)

...

decomp = circ.decompose() pytk_circ = qiskit_to_tk(decomp)

backend = QulacsBackend() compiled_c = backend.get_compiled_circuit(pytk_circ, optimisation_level = 0)

result_handle = backend.process_circuit(compiled_c, n_shots=shots) counts = backend.get_result(handle=result_handle).get_counts()

Alternatively, if the readout bit ordering is what I expect then a circuit which runs in Qiskit is giving nonsense results in Qulacs. What can I play with to ensure that I'm implementing the same circuit?

user34741
  • 11
  • 1

0 Answers0