# How do you verify the output of an X Gate within the Pulse gates framework?

I have found out how to create an X gate for a constant pulse within the Pulse gates framework found on this link: https://qiskit.org/documentation/tutorials/circuits_advanced/05_pulse_gates.html

My question is how would I verify the output of the X gate and see a 0 input state mapped to a 1 output state? I attached a picture of the code I have so far. from qiskit import QuantumCircuit, pulse, transpile

from qiskit.test.mock import FakeValencia

from qiskit.pulse.library import Constant

backend = FakeValencia()

# build circuit that only contains one x gate and one measurement

circ = QuantumCircuit(1, 1)

circ.x(0)

circ.measure(0, 0)

with pulse.build(backend) as my_schedule:

 d0 = pulse.drive_channel(0)

a0 = pulse.acquire_channel(0)

pulse.play(Constant(duration=10, amp=0.1), pulse.drive_channel(0)) #


build the constant pulse

 pulse.delay(20, d0)

pulse.play(pulse.library.Constant(5, 1.0), d0)

pulse.delay(20, d0)

pulse.play(pulse.library.Constant(5, 1.0), d0)

pulse.delay(20, d0)

pulse.play(pulse.library.Constant(5, 1.0), d0)

pulse.delay(20, d0)

pulse.play(pulse.library.Constant(5, 1.0), d0)

pulse.delay(20, d0)

pulse.play(pulse.library.Constant(5, 1.0), d0)


my_schedule.draw()

circ.add_calibration('x', , my_schedule) # map x gate in qubit 0 to my_schedule

circ = transpile(circ, backend)

print(backend.configuration().basis_gates)

circ.draw('mpl', idle_wires=False)

• Can you copy the code here so others can just copy your code to test? Jul 15 at 3:07