mindquantum.algorithm.library.general_ghz_state
- mindquantum.algorithm.library.general_ghz_state(qubits)[源代码]
- 基于零态制备通用GHZ态的线路。 GHZ态通常定义为三个全零态和三个全一态的均匀叠加: \[\left|\text{GHZ}\right> = (\left|000\right> + \left|111\right>)/\sqrt{2}\]- 在本接口中,我们可以创建出任意量子比特规模下任意部分量子比特之间的GHZ态。 - 参数:
- qubits (list[int]) - 需要应用通用GHZ态的量子比特。 
 
- 返回:
- Circuit,可以制备GHZ态的线路。 
 - 样例: - >>> from mindquantum.algorithm.library import general_ghz_state >>> print(general_ghz_state(range(3)).get_qs(ket=True)) √2/2¦000⟩ √2/2¦111⟩ >>> print(general_ghz_state([1, 2]).get_qs(ket=True)) √2/2¦000⟩ √2/2¦110⟩