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

Incorrect intantiation of classes #66

Closed
lazyoracle opened this issue Feb 28, 2021 · 1 comment · Fixed by #98
Closed

Incorrect intantiation of classes #66

lazyoracle opened this issue Feb 28, 2021 · 1 comment · Fixed by #98
Assignees
Labels
bug Something isn't working
Milestone

Comments

@lazyoracle
Copy link
Member

Describe the bug
In c3/utils/parsers.py, multiple class instantiations have not been updated along with changes elsewhere in the code.

c3/c3/utils/parsers.py

Lines 181 to 189 in a4ab975

opt = C2(
dir_path=cfg["dir_path"],
run_name=run_name,
eval_func=eval,
gateset_opt_map=gateset_opt_map,
algorithm=algorithm,
exp_right=exp,
options=options,
)

does not match

c3/c3/optimizers/c2.py

Lines 12 to 30 in a4ab975

class C2(Optimizer):
"""
Object that deals with the closed loop optimal control.
Parameters
----------
dir_path : str
Filepath to save results
eval_func : callable
infidelity function to be minimized
pmap : ParameterMap
Identifiers for the parameter vector
algorithm : callable
From the algorithm library
options : dict
Options to be passed to the algorithm
run_name : str
User specified name for the run, will be used as root folder
"""

Again,

c3/c3/utils/parsers.py

Lines 260 to 272 in a4ab975

opt = C3(
dir_path=cfg["dir_path"],
sampling=sampling_func,
batch_sizes=batch_sizes,
seqs_per_point=seqs_per_point,
opt_map=exp_opt_map,
state_labels=state_labels,
callback_foms=callback_foms,
callback_figs=callback_figs,
algorithm=algorithm,
options=options,
run_name=run_name,
)

does not match

c3/c3/optimizers/c3.py

Lines 21 to 47 in a4ab975

class C3(Optimizer):
"""
Object that deals with the model learning.
Parameters
----------
dir_path : str
Filepath to save results
sampling : str
Sampling method from the sampling library
batch_sizes : list
Number of points to select from each dataset
seqs_per_point : int
Number of sequences that use the same parameter set
pmap : ParameterMap
Identifiers for the parameter vector
state_labels : list
Identifiers for the qubit subspaces
callback_foms : list
Figures of merit to additionally compute and store
algorithm : callable
From the algorithm library
run_name : str
User specified name for the run, will be used as root folder
options : dict
Options to be passed to the algorithm
"""

Suggestions

  • Update the parsers module to match changes elsewhere in the code
  • Add tests to prevent regression
@lazyoracle lazyoracle added the bug Something isn't working label Feb 28, 2021
@lazyoracle lazyoracle added this to the 1.3 milestone Feb 28, 2021
@lazyoracle lazyoracle self-assigned this Mar 2, 2021
@lazyoracle
Copy link
Member Author

The automated creation of C1 optimizer object has been completed and can be used as a base for cleaning up C2 and C3

https://github.com/q-optimize/c3/blame/a4ab9750bf42a5d2976689917c3c202c6f929fba/c3/utils/parsers.py#L34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants