from qiskit import *
import numpy as np
import math
from matplotlib import pyplot as plt
import qiskit
nshots = 8192
IBMQ.load_account()
provider = qiskit.IBMQ.get_provider(hub='ibm-q', group='open', project='main')
device = provider.get_backend('ibmq_belem')
simulator = Aer.get_backend('qasm_simulator')
from qiskit.tools.monitor import job_monitor
from qiskit.ignis.verification.tomography import state_tomography_circuits, StateTomographyFitter
#from qiskit.ignis.mitigation.measurement import complete_meas_cal, CompleteMeasFitter
from qiskit.visualization import plot_histogram

qr = QuantumRegister(4)
cr = ClassicalRegister(3)
qc = QuantumCircuit(qr, cr)
qc.x(3)
qc.h([0,1,2])
qc.draw('mpl')











import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(-np.pi/2, np.pi/2, 1000)   # generate 1000 evenly spaced points between -pi and pi
y_sin = np.abs(np.sin(x/2))                      # compute sin(x) for each x
y_x = np.abs(x/2)                                # set y=x for each x

plt.plot(x, y_sin, label='sin(x)')     # plot sin(x) as a blue line
plt.plot(x, y_x, label='x', color='orange')    # plot x as an orange line
plt.legend()                           # display the legend
plt.show()                             # show the plot


