mindquantum.simulator.get_tableau_string

View Source On Gitee
mindquantum.simulator.get_tableau_string(sim: Simulator | Stabilizer)[source]

Get the string expression of a stabilizer tableau.

Parameters

sim (Simulator) – A stabilizer simulator.

Examples

>>> from mindquantum.simulator import Simulator, get_tableau_string
>>> from mindquantum.core.circuit import Circuit
>>> stabilizer = Simulator('stabilizer', 2)
>>> stabilizer.apply_circuit(Circuit().h(0).x(1, 0))
>>> print(get_tableau_string(stabilizer))
0 0 | 1 0 | 0
0 1 | 0 0 | 0
-------------
1 1 | 0 0 | 0
0 0 | 1 1 | 0