-
Notifications
You must be signed in to change notification settings - Fork 50
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
Create data classes used by the Azure physical costing model #356
Conversation
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.
initial review.
This is still a large PR. it might move more quickly if we can iterate on smaller chunks
algorithm_qubits = _PRETTY_FLOAT # Number of algorithm qubits $Q_{alg}$ | ||
measurements = _PRETTY_FLOAT # Number of measurements $M_R$. | ||
t_gates = _PRETTY_FLOAT # Number of T gates $M_T$. | ||
toffoli_gates = _PRETTY_FLOAT # Number of Toffoli gates $M_{Tof}$. | ||
rotation_gates = _PRETTY_FLOAT # Number of Rotations $M_R$. | ||
rotation_circuit_depth = _PRETTY_FLOAT # Depth of rotation circuit $D_R$. |
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.
these comments are redundant with the attributes section. You can put the latex in the attributes docstring
|
||
|
||
@frozen | ||
class AlgorithmSpecs: |
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.
spec? that's short for specification. This doesn't really specify an algorithm. These are properties of an algorithm
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.
is this class redundant with magic_state_factory.MagicStateCount
? Can you refactor to remove code duplication
"""AlgorithmSpecs is a summary of a quantum algorithm/circuit. | ||
|
||
Attributes: | ||
algorithm_qubits: Number of qubits used by the algorithm. |
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.
Each of these defaults to zero. Is this a sensible default? Please document this fact somewhere in the docstring since there is indirection in the attribute field type
def physical_qubits(self, code_distance: int | np.ndarray) -> int | np.ndarray: | ||
"""Computes number of physical qubits""" |
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 number of physical qubits for the given code distance using this scheme.
also: this needs an abc.abstractmethod
or NotImplementedError
.
def logical_time_step( | ||
self, code_distance: int | np.ndarray, physical_parameters: PhysicalParameters | ||
) -> float: | ||
"""Computes the logical time step.""" |
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.
what
|
||
|
||
@frozen | ||
class QuantumErrorCorrectionScheme: |
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.
is this abstract?
|
||
@frozen | ||
class QuantumErrorCorrectionScheme: | ||
"""QuantumErrorCorrectionScheme represents a quantum error correction scheme. |
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 is an unhelpful line.
A full quantum error correction scheme would include a particular code, decoder, way of doing gates, and many more things. As I understand it: this class captures a small slice of the relevant characteristics of an error correcting code. Consider a more helpful name for this class. And/or consider making this abstract and giving it a concise name (and meaningful names to the implementations).
error_rate_scaler: Logical error rate coefficient. | ||
error_rate_threshold: Logical error rate threshold. |
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.
Please document these constants in terms of the mathematical formula in which they appear. I don't think "error_rate_scaler" is a common term and "error_rate_threshold" would imply that this is a property of the code whereas in reality this is yet another fuzzy parameter that captures the empirical behavior of the error suppression.
Note that we measure/target/think about the parameter
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.
is
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 definition of lambda definitely includes the physical error rate
you can use https://arxiv.org/abs/2207.06431 as a reference for lambda. It's the error at d divided by the error at d+2; i.e. how much suppression you get by increasing the code distance.
Co-authored-by: Matthew Harrigan <[email protected]>
part 1 of splitting #327