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

Typing of functions with Quantity arguments #28

Open
GlaserN opened this issue Jan 29, 2021 · 0 comments
Open

Typing of functions with Quantity arguments #28

GlaserN opened this issue Jan 29, 2021 · 0 comments
Labels
bug Something isn't working can-wait Not working, not urgent good first issue Good for newcomers help wanted Extra attention is needed

Comments

@GlaserN
Copy link
Collaborator

GlaserN commented Jan 29, 2021

Describe the bug
Typing of most objects requiring Quantity objects is wrong, requiring mostly float by itself. In order to get the right typing behavior a way should be found to either associate Quantity objects as float/array or let the methods require Quantity objects in the first place.

Example of the code:

c3/c3/system/chip.py

Lines 57 to 89 in ef95330

class Qubit(PhysicalComponent):
"""
Represents the element in a chip functioning as qubit.
Parameters
----------
freq: np.float64
frequency of the qubit
anhar: np.float64
anharmonicity of the qubit. defined as w01 - w12
t1: np.float64
t1, the time decay of the qubit due to dissipation
t2star: np.float64
t2star, the time decay of the qubit due to pure dephasing
temp: np.float64
temperature of the qubit, used to determine the Boltzmann distribution
of energy level populations
"""
def __init__(
self,
name,
hilbert_dim,
desc=None,
comment=None,
freq=None,
anhar=None,
t1=None,
t2star=None,
temp=None,
params=None,
):

Related: https://github.com/shaimach/c3po/issues/6 and https://github.com/shaimach/c3po/issues/58

@fedroy fedroy added bug Something isn't working good first issue Good for newcomers labels Jan 29, 2021
@lazyoracle lazyoracle added the can-wait Not working, not urgent label Feb 2, 2021
@lazyoracle lazyoracle added the help wanted Extra attention is needed label Feb 20, 2021
fedroy added a commit that referenced this issue May 17, 2021
…partly addresses #28

Main Contributor: Niklas Glaser (GlaserN)
Other Contributors: Federico Roy (fedroy), Maximilian Naegel (MaxNaeg) 

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working can-wait Not working, not urgent good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants