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

read_config() does not parse tasks when creating Model objects #18

Closed
lazyoracle opened this issue Jan 22, 2021 · 1 comment · Fixed by #116
Closed

read_config() does not parse tasks when creating Model objects #18

lazyoracle opened this issue Jan 22, 2021 · 1 comment · Fixed by #116
Assignees
Labels
bug Something isn't working important Needs immediate work
Milestone

Comments

@lazyoracle
Copy link
Member

Describe the bug
read_config() does not parse for tasks when creating Model object

To Reproduce

  • Create a config file with a tasks component
  • Read config file with read_config()
  • Tasks not parsed and included in Model object

Expected behavior
When tasks are included in the config file, they should get instantiated along with the rest of model attributes

c3/c3/system/model.py

Lines 121 to 154 in ef95330

def read_config(self, filepath: str) -> None:
"""
Load a file and parse it to create a Model object.
Parameters
----------
filepath : str
Location of the configuration file
"""
with open(filepath, "r") as cfg_file:
cfg = hjson.loads(cfg_file.read())
for name, props in cfg["Qubits"].items():
props.update({"name": name})
dev_type = props.pop("c3type")
self.subsystems[name] = device_lib[dev_type](**props)
for name, props in cfg["Couplings"].items():
props.update({"name": name})
dev_type = props.pop("c3type")
self.couplings[name] = device_lib[dev_type](**props)
if dev_type == "Drive":
for connection in self.couplings[name].connected:
try:
self.subsystems[connection].drive_line = name
except KeyError as ke:
raise Exception(
f"C3:ERROR: Trying to connect drive {name} to unkown "
f"target {connection}."
) from ke
if "use_dressed_basis" in cfg:
self.dressed = cfg["use_dressed_basis"]
self.__create_labels()
self.__create_annihilators()
self.__create_matrix_representations()

@lazyoracle lazyoracle added the bug Something isn't working label Jan 22, 2021
@lazyoracle lazyoracle added this to the release/1.2 milestone Jan 22, 2021
@lazyoracle lazyoracle changed the title read_config does not parse tasks when creating Model objects read_config() does not parse tasks when creating Model objects Jan 22, 2021
@lazyoracle lazyoracle removed this from the release/1.2 milestone Jan 27, 2021
@lazyoracle
Copy link
Member Author

@lazyoracle lazyoracle added the important Needs immediate work label Feb 2, 2021
@lazyoracle lazyoracle changed the title read_config() does not parse tasks when creating Model objects read_config() does not parse tasks when creating Model objects May 30, 2021
@nwittler nwittler removed their assignment Jun 24, 2021
@lazyoracle lazyoracle added this to the 1.3 milestone Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working important Needs immediate work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants