mindquantum.algorithm.library.qutrit_symmetric_ansatz

View Source On Gitee
mindquantum.algorithm.library.qutrit_symmetric_ansatz(gate: UnivMathGate, basis: str = 'zyz', with_phase: bool = False)[source]

Construct a qubit ansatz that preserves the symmetry of encoding for arbitrary qutrit gate.

This function constructs a parameterized quantum circuit (ansatz) that can implement any qutrit gate while preserving the symmetry required by the qutrit-qubit mapping. The symmetry preservation means that states in the same symmetric subspace will maintain equal amplitudes after the gate operation.

For a single qutrit (mapped to 2 qubits), the symmetric subspaces are:

  • {¦00⟩} for qutrit state ¦0⟩

  • {¦01⟩, ¦10⟩} for qutrit state ¦1⟩

  • {¦11⟩} for qutrit state ¦2⟩

Reference: Synthesis of multivalued quantum logic circuits by elementary gates, Optimal synthesis of multivalued quantum circuits.

Parameters
  • gate (UnivMathGate) – symmetry-preserving qubit gate encoded by qutrit gate.

  • basis (str) – decomposition basis, can be one of "zyz" or "u3". The ZYZ basis uses RZ and RY rotations, while the U3 basis uses the U3 gate. Default: "zyz".

  • with_phase (bool) – whether return global phase in form of a GlobalPhase gate on the qubit circuit. Default: False.

Returns

Circuit, qubit ansatz that preserves the symmetry of qutrit encoding.

Raises

ValueError – If the input gate is not symmetric or if the number of qubits is not compatible with qutrit encoding (must be 2 or 4 qubits).

Examples

>>> from scipy.stats import unitary_group
>>> from mindquantum.core.circuit import Circuit
>>> from mindquantum.core.gates import UnivMathGate
>>> from mindquantum.algorithm import qutrit_symmetric_ansatz, qudit_symmetric_encoding
>>> qutrit_unitary = unitary_group.rvs(3)
>>> qubit_unitary = qudit_symmetric_encoding(qutrit_unitary)
>>> qubit_gate = UnivMathGate('U', qubit_unitary).on([0, 1])
>>> ansatz_circ = qutrit_symmetric_ansatz(qubit_gate)