-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add an example notebook for two-qubit entangling gates #154
Add an example notebook for two-qubit entangling gates #154
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #154 +/- ##
=======================================
Coverage 71.41% 71.41%
=======================================
Files 36 36
Lines 5220 5220
=======================================
Hits 3728 3728
Misses 1492 1492 Continue to review full report at Codecov.
|
The tests break because Tensorflow 2.7 drops support for Python 3.6.x (which is fair I guess). I am not sure if that means we drop support for Tensorflow greater than 2.6.x or we drop support for Python less than 3.7.x (I prefer the latter). |
@alex-simm Can you rebase on |
f7f70bd
to
65fdd83
Compare
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[UPDATE] - This is now resolved.
The notebooks are run in the CI as a sort of integration test to ensure code changes don't break examples and they are always up to date. A high number of iterations can cause the CI to run for very long durations thus bottlenecking development. Can you update the number of function evaluations to something like 100 (instead of 1000) with a comment to increase the evaluations for better results?
# increase maxfevals to 500+ for better results
opt = OptimalControl(
dir_path=log_dir,
fid_func=fidelities.average_infid_set,
fid_subspace=["Q1", "Q2"],
pmap=parameter_map,
algorithm=algorithms.cmaes,
options={
"popsize": 15,
"maxfevals": 100
},
run_name="cnot12"
)
@alex-simm Is this ready to merge from your end? |
Yes it is. I guess the remaining items on the checklist don't apply here |
What
In contrast to the existing two qubit example (
examples/two_qubits.ipynb
), this this an example that specifically optimises entangling gates.Why
Because the optimisation doesn't work. It usually converges to 50-55% fidelity. Either I'm missing something or there is a bug in the C3 code. In any case, we could use this example to find out what's wrong. Maybe someone can point out if or why the optimisation cannot work like this.It is working now using cross-resonance. The final fidelity is about 99%.
How
Similar to the existing two qubit example, but with a CNOT gate.
I tried the same with other SU(4) gates (SWAP, iSWAP, ...) and with LBFGS instead of CMAES, but none of those converged to a good fidelity.Remarks
Checklist
black
andflake8
have been used to ensure styling guidelines are metnumpydoc
style