Feature/cycle benchmarking - #1108
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
| f" +/- {self._undressed_process_fidelity_estimate_std:.5f}" | ||
| ) | ||
|
|
||
| def _analyze(self) -> None: |
There was a problem hiding this comment.
Can we factor out some of this logic? IT's a lot to put in one method, e.g., you could say expectation and fidelity calculations are done separately before actual analysis. (Although, I realize we may already have the momentum of doing this for the other QCVV features.)
There was a problem hiding this comment.
I was considering doing it but didn't find the courage to do it. Guess now is the time
| control_axis=sorted_qubits.index(op.qubits[0]), | ||
| target_axis=sorted_qubits.index(op.qubits[1]), | ||
| exponent=op.gate.exponent, | ||
| ) |
There was a problem hiding this comment.
Is an else branch necessary here? Just so we fail loudly if Cirq CZTargetGateset ever changes, although maybe that's unlikely.
| tableau.apply_z( | ||
| axis=sorted_qubits.index(op.qubits[0]), | ||
| exponent=-round(op.gate.axis_phase_exponent, 4), | ||
| ) |
There was a problem hiding this comment.
Why do the exponents here need to be rounded? Is this just a quirk of cirq.CliffordTableau or is it something about Clifford circuits in general?
There was a problem hiding this comment.
I don't remember exactly why the rounding is here for but I think it has to do with some quirk of cirq.CliffordTableau.
| """ | ||
| records = [] | ||
| data: pd.DataFrame = self.data | ||
| for _, entry in data.iterrows(): |
There was a problem hiding this comment.
Not for this PR, but maybe we should have a separate issue about optimizing this sort of thing (thinking of the pandas iterrows meme: https://ryxcommar.com/2020/01/15/for-the-love-of-god-stop-using-iterrows/).
But also, I think this is fine because we're not running very large experiments anytime soon, and "Premature optimization is the root of all evil."
There was a problem hiding this comment.
That's a good point, I've moved away from iterrows
…handling of dataframe
|
@cdbf1 @vietphamngoc Does this need re-reviewing? Or is it ready to be approved? |
|
@dowusu-antwi if you have the time to give it one final review I think that would be valuable - since this PR has been a bit on/off |
Add cycle benchmarking to the QCVV framework