quite new to quantum computing and I have to do a small presentation on quantum gates using python code(notebook).Also, please review the small code I have written for its correctness. I have some questions also as below:
import matplotlib.pyplot as plt
import numpy as np
from math import pi
from qiskit.quantum_info import Statevector
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, transpile
from qiskit.tools.visualization import circuit_drawer
from qiskit.quantum_info import state_fidelity
from qiskit import BasicAer
from qiskit.visualization import plot_bloch_multivector
backend = BasicAer.get_backend('unitary_simulator')
qc = QuantumCircuit(q)
qc.u(pi/2,pi/4,pi/8,q)
qc.draw(output='mpl')
U gate has a lambda argument. What does it mean by lambda and what effect it have on the bloch sphere?
state = Statevector(qc)
plot_bloch_multivector(state) # argument is a statevector
What is this Statevector function? I am not getting it at all. Also, is the bloch sphere showing the effect different angles applied to the gate and state achieved due to effect of lambda, theta and phi? How to know the effect of lambda?
transpiled_circuit= transpile(qc, backend)
transpiled_circuit.draw(output= "mpl")
What is the effect of transpile function? Does it break the gate into its individual components? Not able to understand its effect?
job = backend.run(transpiled_circuit)
job.result().get_unitary(qc, decimals=3)
What is the function of run? Also, what is the get_unitary giving? Is this get_unitary same as statevector(discussed above)?
Now, I donot know where to put the measure, execute and how to see the histogram and the counts? Also, in this example, I am using "unitary simulator". Is this simulator same as qasm simulator? Thank you in advance for resolving me doubts.