Starting with a 2 qubit (each initialized as $|00\rangle$) I need to apply an $R_y(\theta)$ gate to get the following probabilistics:
- 24% $|00\rangle$
- 56% $|01\rangle$
- 6% $|10\rangle$
- 14% $|11\rangle$
I did the following, however, I am not getting exactly what is being asked for, an anyone help me and tell me where am I wrong?
from math import sqrt, acos, asin from qiskit import QuantumCircuit, Aer, transpile from qiskit.visualization import plot_histogram prob = [0.24, 0.56, 0.06, 0.14] qc = QuantumCircuit(2) # Initialize both with state |00> qc.initialize([1,0], 0) qc.initialize([1,0], 1) qc.ry(2 * acos(sqrt(prob)), 0) qc.ry(2 * asin(sqrt(prob)), 1) qc.measure_all() display(qc.draw('mpl')) backend = Aer.get_backend('aer_simulator') job_sim = backend.run(transpile(qc, backend), shots=1024) result = job_sim.result() plot_histogram(result.get_counts())