mindquantum.core.circuit.shift

View Source On Gitee
mindquantum.core.circuit.shift(circ, inc)[source]

Shift the qubit range of the given circuit.

Parameters
  • circ (circuit) – The circuit that you want to do shift operator.

  • inc (int) – The qubit distance you want to shift.

Examples

>>> from mindquantum.core.circuit import shift, Circuit
>>> circ = Circuit().x(1, 0)
>>> circ
q0: ────■─────

      ┏━┻━┓
q1: ──┨╺╋╸┠───
      ┗━━━┛
>>> shift(circ, 1)
q1: ────■─────

      ┏━┻━┓
q2: ──┨╺╋╸┠───
      ┗━━━┛
Returns

Circuit, the shifted circuit.