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

Arbitrary basis #220

Closed MaxNaeg closed 2 years ago

MaxNaeg commented 2 years ago

What

Added a model subclass that enables simulations in an arbitrary basis specified by the user.

Why

For some applications neither the fully dressed nor the bare basis is appropriate. This is for example the case in a tunable coupler architecture with the qubits set on resonance (see added example notebook).

How

By subclassing the model class and repurposing the already existing functions for the dressed frame, only the function update_drift_eigen(self, ordered=True) needs to be modified.

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 #220 (a9c9c73) into dev (003824c) will increase coverage by 0.10%. The diff coverage is 94.44%.

@@            Coverage Diff             @@
##              dev     #220      +/-   ##
==========================================
+ Coverage   74.72%   74.83%   +0.10%     
==========================================
  Files          38       38              
  Lines        5516     5532      +16     
==========================================
+ Hits         4122     4140      +18     
+ Misses       1394     1392       -2     
Impacted Files Coverage Δ
c3/model.py 87.60% <94.44%> (+1.14%) :arrow_up:

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 003824c...a9c9c73. Read the comment docs.

fedroy commented 2 years ago

@lazyoracle does the codeclimate allowed 4 arguments for a init function make sense? I guess it's not enforced in the previous code and is only showing up now.

lazyoracle commented 2 years ago

I think it is perfectly fine to ignore that specific code climate warning regarding number of arguments in init. I would rather focus on the missing test coverage in the changed code, since codecov says the total coverage goes down by 0.10% and only 50% of the changed code is covered by tests.