mindquantum.simulator.get_stabilizer_string
- mindquantum.simulator.get_stabilizer_string(sim: Simulator | Stabilizer)[源代码]
获取stabilizer模拟器中stabilizer的字符串形式。
- 参数:
sim (Simulator) - 一个stabilizer模拟器。
样例:
>>> from mindquantum.simulator import Simulator, get_stabilizer_string >>> from mindquantum.core.circuit import Circuit >>> stabilizer = Simulator('stabilizer', 2) >>> stabilizer.apply_circuit(Circuit().h(0).x(1, 0)) >>> print(get_stabilizer_string(stabilizer)) destabilizer: +IZ +XI stabilizer: +XX +ZZ