from qiskit import *
from qiskit.pulse.library import Gaussian
from qiskit import pulse
from qiskit.test.mock import FakeArmonk
qc = QuantumCircuit(1, 1)
qubit = 0

qc.measure(0, 0)
backend = FakeArmonk()

with pulse.build(backend, name='hadamard') as h_q0:
    pulse.play(Gaussian(duration=1200, amp=0.1409018732350299, sigma=32), pulse.drive_channel(0))
    reg = pulse.measure(qubit)

enter image description here

job = execute(qc, backend, shots=8000)
from qiskit.tools.monitor import job_monitor
result = job.result()
counts = result.get_counts()
{'0': 7810, '1': 190}

Above is the code that I am working with. I want to make the Gaussian pulse flip the qubit, so that most of the shots are in the 1 state instead of the 0 state. As a right now, the Gaussian pulse has no impact on the results of the job. I am looking at Chapter 6.1 of the Qiskit textbook, but cannot find anything that directly helps me. How would I get the Gaussian pulse involved and have it flip the output of the job?

  • $\begingroup$ I haven't tried your code, but I'm pretty sure you need to delay the measurement pulse until after the Gaussian has finished $\endgroup$
    – chrysaor4
    Aug 12 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.