-
Notifications
You must be signed in to change notification settings - Fork 57
Mirror circuit fidelity estimation support and introduction of benchmarking interface (name TBD) #628
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
base: develop
Are you sure you want to change the base?
Conversation
…pytket import since it is no longer needed
… uses a more reasonable test-ref match verification
…re reference circuit does not use ancillae, other changes
@@ -1893,7 +1893,7 @@ def to_native(self): | |||
""" | |||
return tuple(self) | |||
|
|||
def replacename(self, oldname, newname): | |||
def replace_name(self, oldname, newname): |
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.
Every other class that inherits from Label
calls its corresponding function replace_name()
. Calling Circuit.replace_gatename()
would also return an error if any of the labels were of type LabelTupWithArgs
due to this inconsistency.
@@ -878,7 +878,7 @@ def subgraph(self, nodes_to_keep, reset_nodes=False): | |||
qubit_labels = nodes_to_keep | |||
|
|||
edges = [] | |||
for edge in self.edges(): | |||
for edge in self.edges(include_directions=True): |
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.
Having subgraphs retain the directions of their parent graph makes it easier to use stencils on subgraphs. I can't think of a downside to this behavior. If there is a good reason to discard the direction information in a subgraph, I think it would make sense to add a include_directions
flag to subgraph()
.
@@ -23,7 +26,7 @@ class Gzr(_UnitaryGateFunction): | |||
shape = (2, 2) | |||
|
|||
def __call__(self, theta): | |||
return _np.array([[1., 0.], [0., _np.exp(-1j * float(theta[0]))]]) | |||
return _np.array([[1., 0.], [0., _np.exp(1j * float(theta[0]))]]) |
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.
Defining the Gzr gate with a minus rotation is inconsistent with other resources. It is also internally inconsistent with the definition of the Gzpi2 / C14 gate: _np.array([[1, 0], [0, 1j]], complex)
.
…etween success probability and polarization
Quick note: I expect to be able to merge in #379 tomorrow morning. Once that is on develop I'll ping you and then let's merge develop into your branch to use as the baseline for reviewing. This will knock out a decent number of changes and reduce any redundancy. |
Update: #379 is now merged into develop. It looks like there might be a couple conflicts to resolve when merging develop into your branch, so hopefully those won't be tricky. I'll start my review once that merge is done. |
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.
This file was identical to run_me_with_mpirun.py
.
Merged in develop and fixed a couple of minor things. @coreyostrove, should be ready for your review. |
This PR adds a benchmark creation tool we are calling B-Sqale (for the time being), integrates mirror circuit benchmarking into pyGSTi, and improves Qiskit interfacing.
Circuit mirroring functionality is supported by:
RandomCompilation
class, which OOP-ifies both the central Pauli (https://www.nature.com/articles/s41567-021-01409-7) and random compilation (https://arxiv.org/abs/2204.07568) mirroring routines.pygsti.protocols.mirror_edesign
. The core routine ismake_mirror_edesign
, which creates aCombinedExperimentDesign
whose circuits can be executed to perform mirror circuit fidelity estimation (MCFE). There are three other functions -qiskit_circuits_to_mirror_edesign
,qiskit_circuits_to_fullstack_mirror_edesign
, andqiskit_circuits_to_subcircuit_mirror_edesign
- which build onmake_mirror_edesign
to create different kinds of benchmarks directly from Qiskit circuits.from_mirror_experiment
class method for theVBDataFrame
class, which streamlines the analysis process for MCFE. TheVBDataFrame
class also now includes plotting functionality for creating volumetric benchmarking plots from subcircuit mirror experiments.This PR also adds B-Sqale (name subject to change), a scalable and robust benchmark creation tool, to pyGSTi. More information will be available in a forthcoming paper. The submodule
pygsti.tools.bsqale
provides wrappers for the mirror benchmarking functionality:noise_mirror_benchmark
(wrapper forqiskit_circuits_to_mirror_edesign
)fullstack_mirror_benchmark
(wrapper forqiskit_circuits_to_fullstack_mirror_edesign
)subcircuit_mirror_benchmark
(wrapper forqiskit_circuits_to_subcircuit_mirror_edesign
)calculate_mirror_benchmark_results
(wrapper forVBDataFrame.from_mirror_experiment
)These wrappers are provided in anticipation of expanding B-Sqale to scalable benchmarking techniques beyond MCFE.
Interfacing with Qiskit is supported by the addition of a
from_qiskit
class method andconvert_to_qiskit
method to theCircuit
class.