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

Hamiltonian generation and instruction handling #87

Merged
merged 35 commits into from
May 17, 2021

Conversation

GlaserN
Copy link
Collaborator

@GlaserN GlaserN commented May 11, 2021

This merge most importantly has the ability to request time sliced hamiltonians form the LineComponents to get time dependent drift hamiltonians. Furthermore awg signal generation has been moved to the Instruction object giving the pulse positioning more options.

Many more new features and fixes are included in this merge, including:

  • Device Hamiltonian can be time dependent essentially not separating anymore between h0 and hctrl but time sliced Hamiltonian already in model. Default is still with control field hamiltonians.
  • Additional chip devices (CShuntFluxQubit, Fluxonium, Duffing oscillator up to 6th order)
  • Moved AWG signal generation to the Instruction object instead.
  • Pulses can now be triggered to happen after a component of the instruction is finished
  • Quantity object operations are performed and return a quantity object
  • Set value has extend bounds option and has better tensorflow compatibility
  • Quantity: get and set limits functions added
  • Add FFT convolution based filters that can be described by a Stepfunction.
  • New Logger class for optimizer implemented for TensorBoard
  • Fixed unitary fidelity for gates acting on multiple qubits. Get perfect gate of instructions now behaves as expected for multi-qubit gates. Concatenated ideal gates can be defined again.
  • Propagation has now option for batching (useful only when not evaluating gradient)
  • Additional functions in parameter map
  • Slightly enhanced matrix cutting
  • Better handling of overly dressed states
  • Added gradient free scipy lbfgs algorithm
  • Additional default gates according to QASM notation
  • Added shapes
  • Removed all json occurrences
  • Vectorize lindblad propagation
  • Length of devices is forced to be a multiple of the resolution

GlaserN and others added 30 commits February 10, 2021 16:31
Filtering devices# with '#' will be ignored, and an empty message aborts the commit.
Optimize Lindblad calculation?
Change default ADAM learning rate to reasonable value.
Option to not overwrite unitaries
Allow batching for vectorized propagation
get dressed qubit frequencies and state labels from model
generalize pauli_basis
Add Transmon with full expansion
Fixes of chip elements for full hamiltonian + Typing
unify usage of opt_map
Extend compexity of slepian_fourier function
option of projector to output any dimension
Nicer printing
fixes in Quantity object
extend bounds in set_value
Additional flags and options in experiment
update_parameter function in parametermap
add nophase fidelity
@GlaserN GlaserN requested a review from fedroy May 11, 2021 17:53
@lgtm-com
Copy link

lgtm-com bot commented May 11, 2021

This pull request introduces 2 alerts and fixes 2 when merging 39583d7 into 40cb690 - view on LGTM.com

new alerts:

  • 1 for Unreachable 'except' block
  • 1 for Module is imported with 'import' and 'import from'

fixed alerts:

  • 1 for Suspicious unused loop iteration variable
  • 1 for Unused exception object

c3/utils/utils.py Outdated Show resolved Hide resolved
c3/system/chip.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented May 12, 2021

Codecov Report

Merging #87 (27b1c48) into dev (40cb690) will increase coverage by 3.94%.
The diff coverage is 60.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev      #87      +/-   ##
==========================================
+ Coverage   47.54%   51.48%   +3.94%     
==========================================
  Files          36       36              
  Lines        4556     5409     +853     
==========================================
+ Hits         2166     2785     +619     
- Misses       2390     2624     +234     
Impacted Files Coverage Δ
c3/generator/generator.py 93.93% <ø> (-0.18%) ⬇️
c3/qiskit/c3_backend.py 78.80% <ø> (ø)
c3/libraries/algorithms.py 17.51% <13.33%> (-0.18%) ⬇️
c3/system/chip.py 45.61% <26.87%> (-29.50%) ⬇️
c3/utils/tf_utils.py 35.17% <30.43%> (-5.32%) ⬇️
c3/libraries/fidelities.py 21.40% <32.35%> (+1.01%) ⬆️
c3/signal/pulse.py 80.51% <33.33%> (-11.42%) ⬇️
c3/utils/utils.py 64.64% <37.50%> (+8.73%) ⬆️
c3/generator/devices.py 64.65% <45.65%> (-3.75%) ⬇️
c3/experiment.py 58.63% <58.00%> (-1.61%) ⬇️
... and 16 more

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 40cb690...27b1c48. Read the comment docs.

lazyoracle
lazyoracle previously approved these changes May 12, 2021
@lgtm-com
Copy link

lgtm-com bot commented May 12, 2021

This pull request fixes 2 alerts when merging 554e17f into 40cb690 - view on LGTM.com

fixed alerts:

  • 1 for Suspicious unused loop iteration variable
  • 1 for Unused exception object

@lazyoracle
Copy link
Member

The test coverage goes down by more than a percent, do we wish to make this pull request complete by adding tests in this PR or would that come separately?

@lgtm-com
Copy link

lgtm-com bot commented May 12, 2021

This pull request fixes 2 alerts when merging 796a68f into 40cb690 - view on LGTM.com

fixed alerts:

  • 1 for Suspicious unused loop iteration variable
  • 1 for Unused exception object

@lgtm-com
Copy link

lgtm-com bot commented May 16, 2021

This pull request fixes 2 alerts when merging d06b224 into 40cb690 - view on LGTM.com

fixed alerts:

  • 1 for Suspicious unused loop iteration variable
  • 1 for Unused exception object

@lgtm-com
Copy link

lgtm-com bot commented May 16, 2021

This pull request fixes 2 alerts when merging 27b1c48 into 40cb690 - view on LGTM.com

fixed alerts:

  • 1 for Suspicious unused loop iteration variable
  • 1 for Unused exception object

@lazyoracle
Copy link
Member

As noted by @shaimach for the purpose of reporting metrics and tracking changes, contributors/reviewers with write access (in this case @fedroy), please make sure the merge commit message (the one which appears when you try to Merge pull request on Github) for this PR has the following template. This PR description is already descriptive enough that it could form the basis for the multi-line detailed merge commit message:

Short 1-line description of key feature/bug-fix with associated issue numbers if any (can go in the commit heading in Github PR merge UI)

(The part below goes in the merge commit message details)
Contributors: Full name (and not Github handle) of all contributors to this PR, irrespective of who made the code commits.
Longer multi-line description, typically in the form of a detailed list of various features implemented with any additional insights/remarks on the implementations etc.

Copy link
Collaborator

@fedroy fedroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked at all changes together and I can confirm that the code is ready for being merged.
Lots of useful new feature that also align well with future development.

Copy link
Member

@lazyoracle lazyoracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@fedroy fedroy merged commit 8e747d5 into q-optimize:dev May 17, 2021
@lazyoracle lazyoracle added this to the 1.3 milestone May 17, 2021
@lazyoracle lazyoracle mentioned this pull request May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants