paddle_quantum.mbqc.mcalculus
This module contains the related operations for the MBQC measurement patterns.
- class paddle_quantum.mbqc.mcalculus.MCalculus
Bases:
object
Define the class MCalculus.
According to the paper’s [The measurement calculus, arXiv: 0704.1263] measurement language, this class provides series of basic operations dealing with measurement patterns.
- track_progress(track=True)
The button for revealing the progress bar during dealing with the measurement pattern.
- Parameters:
track (bool, optional) –
True
open the progress bar,False
close the progress bar, the default isTrue
- set_circuit(circuit)
Set the quantum circuit for the
MCalculus
class.- Parameters:
circuit (Circuit) – quantum circuit
- standardize()
Standardize the measurement pattern.
This method standardize the measurement pattern to the equivalent EMC model. The method exchange all the “Command E” to the first, followed by “Command M”, “Command X” and “Command Z”. To simplify the measurement pattern, this method applies Pauli simplification to “Command M” after the standardization.
- shift_signals()
Signal shifting operation
Note
This is one of the choices of the users.
- get_pattern()
Return the measurement pattern
- Returns:
the measurement pattern after processing.
- Return type:
Pattern
- optimize_by_row()
Optimize the measurement order in the measurement pattern according to row major order.
Warning
This is a heuristic optimization algorithm works for specific measurement patterns. It’s also possible to find better measurement order. For example, for a shallow quantum circuit, a specific qubit is no more needed after the quantum measurements according to the row major order such that the computational cost in the follow-up process is simplified.