mindquantum.simulator.mqchem.UCCExcitationGate

View Source On Gitee
class mindquantum.simulator.mqchem.UCCExcitationGate(fermion_operator: FermionOperator)[source]

Unitary Coupled-Cluster (UCC) excitation gate, for use with the MQChemSimulator.

This gate represents the unitary operator \(e^{G}\) where \(G\) is an anti-Hermitian generator of the form \(G = \theta (T - T^\dagger)\). Here, \(T\) is a fermionic excitation operator that conserves both spin and electron number. The operator is commonly used in the UCC ansatz for variational quantum algorithms in quantum chemistry.

Note

This gate is specifically designed for the MQChemSimulator and relies on its internal CI-space representation. It is not compatible with the standard state-vector Simulator.

The gate is defined as:

\[U(\theta) = \exp(\theta(T - T^\dagger))\]

where \(T\) must be a single-term FermionOperator, for example, \(a_p^\dagger a_q\).

Parameters

fermion_operator (FermionOperator) – The fermionic excitation operator \(T\). It must contain exactly one term. The coefficient of this term is used as the rotation angle \(\theta\). If the coefficient is a variable, the gate will be parametric.

Examples: >>> from mindquantum.simulator import mqchem >>> from mindquantum.core.operators import FermionOperator

>>> # Non-parametric gate
>>> t = FermionOperator('2^ 0', 0.5)
>>> non_parametric_gate = mqchem.UCCExcitationGate(t)
>>> non_parametric_gate
exp{(1/2)([2^ 0] + [2 0^])}
>>>
>>> # Parametric gate
>>> t_para = FermionOperator('3^ 1', 'theta')
>>> parametric_gate = mqchem.UCCExcitationGate(t_para)
>>> parametric_gate
exp{(theta)([3^ 1] + [3 1^])}
get_cpp_obj(n_qubits: int, n_electrons: int, backend)[source]

Get the underlying C++ CppExcitationOperator binding object.

Note

This method is for internal use by the MQChemSimulator.

Parameters
  • n_qubits (int) – The total number of qubits (spin-orbitals) in the system.

  • n_electrons (int) – The total number of electrons in the system.

  • backend – The C++ backend module (_mq_chem.float or _mq_chem.double).

Returns

The C++ object used for simulation.