q-optimize / c3

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

Updating Instruction name directly doesn't update its ideal gate #233

Closed YonatanGideoni closed 2 years ago

YonatanGideoni commented 2 years ago

Bug description

When updating an Instruction's name its ideal gate isn't updated, leading to inconsistencies.

To Reproduce

from examples.single_qubit_experiment import create_experiment

exp = create_experiment()
print(exp.pmap.instructions['ry90p[0]'].get_ideal_gate(dims=[2]))

Expected behavior

Should print:

[[ 0.70710678+0.j -0.70710678+0.j]
 [ 0.70710678+0.j  0.70710678+0.j]]

Real output:

[[0.70710678+0.j         0.        -0.70710678j]
 [0.        -0.70710678j 0.70710678+0.j        ]]

(rx90 gate it was deepcopied from)

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

Solution

Add proper getter/setter for name.