q-optimize / c3

Toolset for control, calibration and characterization of physical systems
https://c3-toolset.readthedocs.io/
Apache License 2.0
66 stars 36 forks source link

Cooper pair box #184

Open superplay1 opened 2 years ago

superplay1 commented 2 years ago

What

It adds the class CooperPairBox model to chip.py

Why

Additional functionality for regions where code of Fluxonium model fails.

How

I calculate the Hamiltonian in charge basis a-nd diagonalize to be again in energy basis. The transformation to the energy basis is done for the initial ng-value.

Remarks

I noticed that sometimes tf.range() does not what it should when the used dimensions size is big.

Regarding the checklist below -I don't know how to write tests properly. -I am not sure if a notebook is really necessary. You could just take the two_qubit_example and use CooperPairBox instead of Transmon except that I am not sure If coupling will work in the same way. -The Documentation is generated automatically, isn't it? If not I don't know how to update it. -Don't know how to add something the Upcoming Release section

Checklist

Please include and complete the following checklist. Your Pull Request is (in most cases) not ready for review until the following have been completed. You can create a draft PR while you are still completing the checklist. Check the Contribution Guidelines for more details. You can mark an item as complete with the - [x] prefix

codecov[bot] commented 2 years ago

Codecov Report

Merging #184 (a1aa398) into dev (bd06408) will decrease coverage by 0.63%. The diff coverage is 12.06%.

:exclamation: Current head a1aa398 differs from pull request most recent head 1d685e5. Consider uploading reports for the commit 1d685e5 to get more accurate results

@@            Coverage Diff             @@
##              dev     #184      +/-   ##
==========================================
- Coverage   73.24%   72.61%   -0.64%     
==========================================
  Files          37       37              
  Lines        5561     5619      +58     
==========================================
+ Hits         4073     4080       +7     
- Misses       1488     1539      +51     
Impacted Files Coverage Δ
c3/libraries/chip.py 53.20% <12.06%> (-4.47%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bd06408...1d685e5. Read the comment docs.

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging 3c7588a7c5069f12a0bd121a6be62c98eb602665 into bd064081f722dfd3609afebf1b3f80cee45f9d07 - view on LGTM.com

new alerts:

lazyoracle commented 2 years ago

Re: Tests

The contributing guide has a section on tests to help onboard new contributors to writing tests for their code. The basic idea is to convert one of the scripts that you are using for checking your code into the structure for a test script following the pattern seen in the other tests in our repo. It also includes a link to resources to better understand how to write tests in python. Can you please go through them and let us know if they are not adequate/useful enough to help you write tests for this PR? We can use this feedback to improve the onboarding document.