# (C) Copyright IBM 2024.## This code is licensed under the Apache License, Version 2.0. You may# obtain a copy of this license in the LICENSE.txt file in the root directory# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.## Any modifications or derivative works of this code must retain this# copyright notice, and modified files need to carry a notice indicating# that they have been altered from the originals."""(Local) unitary cluster Jastrow ansatz gate."""from__future__importannotationsfromcollections.abcimportIterator,Sequencefromqiskit.circuitimport(CircuitInstruction,Gate,QuantumCircuit,QuantumRegister,Qubit,)fromtyping_extensionsimportdeprecatedfromffsim.qiskit.gates.diag_coulombimportDiagCoulombEvolutionJWfromffsim.qiskit.gates.orbital_rotationimportOrbitalRotationJWfromffsim.variationalimportUCJOperator
[docs]@deprecated("The UCJOperatorJW class is deprecated. Use UCJOpSpinBalancedJW instead.")classUCJOperatorJW(Gate):"""Unitary cluster Jastrow operator under the Jordan-Wigner transformation. .. warning:: This class is deprecated. Use :class:`ffsim.qiskit.UCJOpSpinBalancedJW` instead. See :class:`ffsim.UCJOperator` for a description of this gate's unitary. This gate assumes that qubits are ordered such that the first `norb` qubits correspond to the alpha orbitals and the last `norb` qubits correspond to the beta orbitals. """
[docs]def__init__(self,ucj_operator:UCJOperator,*,label:str|None=None):"""Create a new unitary cluster Jastrow (UCJ) gate. Args: ucj_operator: The UCJ operator. label: The label of the gate. """self.ucj_operator=ucj_operatorsuper().__init__("ucj_jw",2*ucj_operator.norb,[],label=label)