-
Notifications
You must be signed in to change notification settings - Fork 131
Add ZZ experiment #782
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
Add ZZ experiment #782
Conversation
if "granularity" in backend.configuration().timing_constraints: | ||
self.granularity = backend.configuration().timing_constraints["granularity"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to do something like this to account for the backend configuration not having timing_constraints:
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
These should never fire but it doesn't hurt to have them in case hardware alignment changes in the future
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
…ing timing functionality where necessary
c0bf580
to
d793ab0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @thaddeus-pellegrini @wshanks, overall this looks good to me. Handling of missing backend dt seems bit redundant but apart from this logic I like how this experiment is implemented. I don't really carefully read initial guess algorithm because we can eventually use #896.
qiskit_experiments/library/characterization/analysis/zz_ramsey_analysis.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/library/characterization/analysis/zz_ramsey_analysis.py
Outdated
Show resolved
Hide resolved
Returns: | ||
Circuits for series 0 and 1 | ||
""" | ||
circ0, circ1 = self._parameterized_circuits(delay_unit=delay_unit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we cannot directly generate these circuits inside the method? Personally I don't like having too many (unnecessary) helper functions because it makes reading the code harder. Do you plan to add another experiment with variant of ZZRamsey? Parameterizing pi
and dt
for handling of missing dt seems overengineering. Alternatively you can call timing helper also inside _parameterized_circuits
becasue this method knows self.backend
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main purpose of splitting _parameterized_circuits
from _template_circuits
is that I want a method that produces circuits that print nicely. _parameterized_circuits
was used to generate the circuit representation in the doc string for example. I tried to make this more clear in a223230 by shifting the parameterizing out into its own method, so it is not part of the .circuits()
chain.
Now it is a standalone method that re-engineers the circuit values instead of a part of the main `.circuits()` flow.
3bde3cc
to
63f8ed6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
return circ0, circ1 | ||
|
||
def parametrized_circuits(self) -> Tuple[QuantumCircuit, QuantumCircuit]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention of parameterization is much clear now. This looks good to me.
Summary
Details and comments
TODO:
Must make tests
Must complete documentation