As part of another project I need to be able to run a custom pulse schedule for a bell ciruit and measure the counts. However I am having a problem where running the scheduled circuit is giving counts only in the states 00 and 01 and if I use a pulse simulator to run the schedule I get approximately an even distribution across all states when I would expect a 50/50 distribution between the 00 and 11 states.
Here is an example:
from qiskit import QuantumCircuit, transpile, schedule, assemble
from qiskit.test.mock.backends.bogota import FakeBogota
from qiskit.providers.aer import PulseSimulator
from qiskit.providers.aer.pulse import PulseSystemModel
backend = FakeBogota()
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0,1)
qc.measure_active()
#Running transpiled circuit
circ_transpiled = transpile(qc, backend)
transpiled_counts = backend.run(circ_transpiled,shots = 2048).result().get_counts()
#Running scheduled circuit
sched = schedule(circ_transpiled,backend)
sched_counts = backend.run(sched,shots = 2048).result().get_counts()
#Running schedule using a pulse simulator
backend_model= PulseSystemModel.from_backend(backend)
backend_sim = PulseSimulator()
qubit_lo_freq = backend_model.hamiltonian.get_qubit_lo_from_drift()
test_qobj = assemble(sched,
backend = backend_sim,
qubit_lo_freq = qubit_lo_freq,
meas_level = 2,
meas_return = 'single',
shots = 2048)
sim_counts = backend_sim.run(test_qobj, system_model=backend_model).result().get_counts()
print('Transpiled counts = {}'.format(transpiled_counts))
print('Scheduled counts = {}'.format(sched_counts))
print('Sim counts = {}'.format(sim_counts))
This particular example gives: Transpiled counts = {'11': 945, '00': 957, '01': 69, '10': 77} Scheduled counts = {'00': 382, '01': 1666} Sim counts = {'00': 404, '01': 537, '10': 448, '11': 659}
What is the reason for the discrepencies between the different methods and is there a correct way to produce the correct counts using the scheduler?