q-optimize / c3

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

Refactor signal generation #202

Closed nwittler closed 2 years ago

nwittler commented 2 years ago

What

Cleanup the signal generation.

Why

Was a mess. Closes #201 Closes #195 (I hope)

How

Following on the initial changes that move parts of the signal generation into the Instruction, this change moves the handling of the previous "drag" and "pwc" options from the AWG into the Envelope.

Remarks

This removes a ton of ugly branching code in the signal generation in the AWG. This requires updating config files to remove the DRAG or PWC options from the AWG. DRAG is now enabled by using EnvelopeDrag. To use PWC, simply use the PWC envelope from the library and directly use vectors of "inphase" and "quadrature" as parameters in the Instruction. To be able to specify I and Q signals for PWC directly, we also need to treat envelope functions as complex. Previously the code would cast them at some point but we get more degrees of freedom this way.

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

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

lazyoracle commented 2 years ago

Ignoring the CLA warning for now. When the PR is ready, we can use something like git-filter-repo to update the commit author and email, rebase and force push. That will clear up any CLA issues.

codecov[bot] commented 2 years ago

Codecov Report

Merging #202 (16d6c50) into dev (f727420) will increase coverage by 0.55%. The diff coverage is 97.95%.

:exclamation: Current head 16d6c50 differs from pull request most recent head 6ce6ff5. Consider uploading reports for the commit 6ce6ff5 to get more accurate results

@@            Coverage Diff             @@
##              dev     #202      +/-   ##
==========================================
+ Coverage   74.12%   74.67%   +0.55%     
==========================================
  Files          38       38              
  Lines        5588     5533      -55     
==========================================
- Hits         4142     4132      -10     
+ Misses       1446     1401      -45     
Impacted Files Coverage Δ
c3/signal/pulse.py 84.15% <94.73%> (+2.98%) :arrow_up:
c3/generator/devices.py 71.60% <100.00%> (+3.61%) :arrow_up:
c3/libraries/envelopes.py 99.51% <100.00%> (+0.49%) :arrow_up:
c3/signal/gates.py 95.02% <100.00%> (+4.73%) :arrow_up:
c3/utils/tf_utils.py 65.03% <100.00%> (+0.43%) :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 f727420...6ce6ff5. Read the comment docs.

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging c684fc7640d3d9596aad90561c033c6099b0ff63 into f7274202c017d296be052723f555faaf8820b2b3 - view on LGTM.com

new alerts: