mindquantum.algorithm.compiler.cu_decompose

mindquantum.algorithm.compiler.cu_decompose#

mindquantum.algorithm.compiler.cu_decompose(gate, with_barrier=False)#

对任意维度的受控幺正门进行分解。

该门拥有 \(m\) 个控制比特和 \(n\) 个作用比特。 当迭代的调用函数本身时,\(m\) 将会逐步减小并保持 \(n\) 恒定。

参数:
  • gate (QuantumGate) - 量子门实例。

  • with_barrier (bool) - 是否在分解时加入 BarrierGate。默认值: False

返回:

Circuit,由单比特门和CNOT门构成的量子线路。