Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 Qubit rotated RB circuits for calibrator #2311

Open
bdg221 opened this issue Apr 19, 2024 · 5 comments
Open

2 Qubit rotated RB circuits for calibrator #2311

bdg221 opened this issue Apr 19, 2024 · 5 comments
Assignees
Labels
benchmarks Tools for benchmarking error mitigation methods. calibration

Comments

@bdg221
Copy link
Collaborator

bdg221 commented Apr 19, 2024

Issue Description

This is a continuation of #2065 which handled the 1 qubit rotated rb circuit. In this issue, we are looking to address the 2 qubit scenario.

The primary task of this issue is to determine the ideal distribution of the 2 qubit rotated RB circuits and then update the code similar to #2248 which is the PR that handled the 1 qubit case.

Additional References

Below are some references from #2065 :
Volumes of Compact Manifolds
A Parametrization of Bipartite Systems Based on SU (4) Euler Angles

@bdg221 bdg221 added benchmarks Tools for benchmarking error mitigation methods. calibration labels Apr 19, 2024
@bdg221
Copy link
Collaborator Author

bdg221 commented Apr 19, 2024

The first step will be do some numerical simulations of the rotated_rb circuits and plot the probabilities. This will give a rough idea of the expected results.

@bdg221
Copy link
Collaborator Author

bdg221 commented Apr 23, 2024

Here is the code I used for generating the probability of 00 along with the resulting graph:

n_qubits = 2
depth = 10
trials = 1
results= {}

for i in range(101):
    theta = (4 / 100) * math.pi * i
    circ = generate_rotated_rb_circuits(
            n_qubits=n_qubits, num_cliffords=depth, theta=theta, trials=trials, return_type="cirq"
        )
    results[str(theta)] = mitiq_cirq.compute_density_matrix(circuit=circ[0], noise_level=(0.0,))

plt.xlabel('theta')
plt.ylabel(' prob of 00')

tick_lbls = ['1/2 pi', 'pi', '3/2 pi', '2 pi', '5/2 pi', '3 pi', '7/2 pi', '4 pi']
plt.xticks(np.round(np.arange(math.pi/2, 9*math.pi/2, step=(math.pi/2)), 2).tolist(), tick_lbls)

plt.plot([float(k) for k in results.keys()], [results[str(t)][0][0]**2 for t in results.keys()], 's')

image

@bdg221
Copy link
Collaborator Author

bdg221 commented Apr 24, 2024

I realized that I squared the [0][0] value from the results. Here is the correct plot:
image

@FarLab
Copy link
Contributor

FarLab commented Apr 25, 2024

So I think you are having the same confusion as I had previously when I worked on this problem :)
You are plotting the distribution for just one random rotated rb circuit, where we actually need to take an average over many different samples of these circuits (this is also the reason why you are seeing probability 1 sometimes out of nowhere). Concretely, you would have to set trials=100 or some other large number and then take the average of the distributions each circuit creates. I did this and I get the following for measuring 00 and 11.
output
If you want, you could try to get the distribution for 01 and 10. Let me know if something is unclear. @bdg221

@bdg221
Copy link
Collaborator Author

bdg221 commented Apr 26, 2024

I was able to complete the plot for measuring 00, 01, 10, and 11. You were correct about increasing the number of trials.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmarks Tools for benchmarking error mitigation methods. calibration
Projects
None yet
Development

No branches or pull requests

2 participants