-
Notifications
You must be signed in to change notification settings - Fork 127
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
Scan values should be run-time option #42
Comments
Thanks @nkanazawa1989. Here are a few thoughts:
|
See this example t1exp = T1Experiment(qubit=0)
exp_data = t1exp.run(backend, delays=np.linspace(0, 100e-6, 10))
exp_data.analysis_result(0) # check the result plot, fit is poor due to wrong initial guess of scan range
# add other data points
exp_data = t1exp.run(backend, delays=np.linspace(0, 10e-6, 10), experiment_data=exp_data) If scan values are runtime option, such workflow can be written more smoothly.
Even if we upgrade the experiment option with #39, t1exp.delays doesn't make sense. If we run the second scan in above example, the delays that
I think you misunderstand the parameter. Parametrized circuit defines a template program (just a single entry), and you can assign arbitrary numbers of parameters later on, by calling
I didn't carefully follow the discussion of T1 PR. If there is any reasonable reason, I'm fine with current implementation. |
@nkanazawa1989 It makes sense to me. Additional opinions will be helpful, in case that we miss something. @coruscating @wshanks |
@nkanazawa1989 Is it relevant to other experiments as well? For example I've just noticed that #31 has the same structure, and actually I guess that it's the same for all the experiments that we did until now. |
I have not worked with the experiments API enough to have a strong opinion about @nkanazawa1989's example of visualizing a parametrized circuit is a good argument for preferring a parametrized template circuit over generating a set of completed circuits. Not all experiments fit the format of a scanning one parameter of a single parametrized circuit but a lot of them do. Should this be standardized in some way like a subclass for scanned experiments? Right now T1 does not override the That said, I think I would just run a new T1 experiment if I wanted a different range 🙂 I think we have said we want to support taking additional data in general though. |
#65 is relevant here |
I'll reconsider this issue, hopefully soon |
I think currently most of classes conform to this behavior class Experiment(BaseExperiment):
def __init__(qubits, my_scan_values):
super().__init__(qubits)
self.set_experiment_options(scan_values=my_scan_values) Probably removing something like |
Do you think it's important to convert T1 circuits into a single parametrized circuit? |
Closing because the current implementation seems to be ok |
What is the expected behavior?
In the current implementation of T1 experiment,
delays
is passed to the constructor and becomes an immutable instance variable. This should be runtime option so that we can update scan range without creating new instance.For me, in the experiment that scans some parameters, it is more preferable if we can check the parametrized circuit rather than list of circuits with assigned parameters. This can be implemented with
and in
.circuits
methodThis will allow us to check the circuit with parameter.
The text was updated successfully, but these errors were encountered: