CHP Simulator

Implementation of the Aarenson/Gottesman CHP stabilizer simulator

source

MeasureResult

 MeasureResult (value:bool, determined:bool)

A measurement’s output and whether it was random or not.


source

pauli_product_phase

 pauli_product_phase (x1:bool, z1:bool, x2:bool, z2:bool)

Determines the power of i in the product of two Paulis.

For example, X*Y = iZ and so this method would return +1 for X and Y.

The input Paulis are encoded into the following form:

x z | Pauli
----+-------
0 0 | I
1 0 | X
1 1 | Y
0 1 | Z

source

ChpSimulator

 ChpSimulator (num_qubits)

The bare minimum needed for the CHP simulation.

Original author: Craig Gidney (https://github.com/Strilanc/python-chp-stabilizer-simulator)

Changes: np.bool -> bool (reason: np.bool is deprecated since numpy>=1.23)

Reference: “Improved Simulation of Stabilizer Circuits” Scott Aaronson and Daniel Gottesman https://arxiv.org/abs/quant-ph/0406196


source

StabilizerSimulator

 StabilizerSimulator (num_qubits)

The bare minimum needed for the CHP simulation.