mindquantum.algorithm.compiler.qs_decompose =========================================== .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.5.0/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindquantum/blob/r0.10/docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.qs_decompose.rst :alt: 查看源文件 .. py:function:: mindquantum.algorithm.compiler.qs_decompose(gate: QuantumGate, with_barrier: bool = False) 任意维幺正量子门的矩阵的香农分解。 该分解方法中的CNOT门数量为: .. math:: O(4^n) 了解更多详细信息,请参考 `Synthesis of Quantum Logic Circuits `_。 参数: - **gate** (:class:`~.core.gates.QuantumGate`) - 量子门实例。 - **with_barrier** (bool) - 是否在分解时加入 :class:`~.core.gates.BarrierGate`。默认值: ``False``。 返回: :class:`~.core.circuit.Circuit`,由单比特门和CNOT门构成的量子线路。