qml.templates.subroutines.SingleExcitationUnitary¶

SingleExcitationUnitary
(weight, wires=None)[source]¶ Circuit to exponentiate the tensor product of Pauli matrices representing the singleexcitation operator entering the Unitary CoupledCluster Singles and Doubles (UCCSD) ansatz. UCCSD is a VQE ansatz commonly used to run quantum chemistry simulations.
The CC singleexcitation operator is given by
\[\hat{U}_{pr}(\theta) = \mathrm{exp} \{ \theta_{pr} (\hat{c}_p^\dagger \hat{c}_r \mathrm{H.c.}) \},\]where \(\hat{c}\) and \(\hat{c}^\dagger\) are the fermionic annihilation and creation operators and the indices \(r\) and \(p\) run over the occupied and unoccupied molecular orbitals, respectively. Using the JordanWigner transformation the fermionic operator defined above can be written in terms of Pauli matrices (for more details see arXiv:1805.04340).
\[\hat{U}_{pr}(\theta) = \mathrm{exp} \Big\{ \frac{i\theta}{2} \bigotimes_{a=r+1}^{p1}\hat{Z}_a (\hat{Y}_r \hat{X}_p) \Big\} \mathrm{exp} \Big\{ \frac{i\theta}{2} \bigotimes_{a=r+1}^{p1} \hat{Z}_a (\hat{X}_r \hat{Y}_p) \Big\}.\]The quantum circuit to exponentiate the tensor product of Pauli matrices entering the latter equation is shown below (see arXiv:1805.04340):
As explained in Seely et al. (2012), the exponential of a tensor product of PauliZ operators can be decomposed in terms of \(2(n1)\) CNOT gates and a singlequbit Zrotation referred to as \(U_\theta\) in the figure above. If there are \(X\) or \(Y\) Pauli matrices in the product, the Hadamard (\(H\)) or \(R_x\) gate has to be applied to change to the \(X\) or \(Y\) basis, respectively. The latter operations are denoted as \(U_1\) and \(U_2\) in the figure above. See the Usage Details section for more information.
 Parameters
weight (float) – angle \(\theta\) entering the Z rotation acting on wire
p
wires (Iterable or Wires) – Wires that the template acts on. The wires represent the subset of orbitals in the interval
[r, p]
. Must be of minimum length 2. The first wire is interpreted asr
and the last wire asp
. Wires in between are acted on with CNOT gates to compute the parity of the set of qubits.
 Raises
ValueError – if inputs do not have the correct format
Usage Details
Notice that:
\(\hat{U}_{pr}(\theta)\) involves two exponentiations where \(\hat{U}_1\), \(\hat{U}_2\), and \(\hat{U}_\theta\) are defined as follows,
\[[U_1, U_2, U_{\theta}] = \Bigg\{\bigg[R_x(\pi/2), H, R_z(\theta/2)\bigg], \bigg[H, R_x(\frac{\pi}{2}), R_z(\theta/2) \bigg] \Bigg\}\]For a given pair
[r, p]
, ten singlequbit and4*(len(wires)1)
CNOT operations are applied. Notice also that CNOT gates act only on qubitswires[1]
towires[2]
. The operations performed across these qubits are shown in dashed lines in the figure above.
An example of how to use this template is shown below:
import pennylane as qml from pennylane.templates import SingleExcitationUnitary dev = qml.device('default.qubit', wires=3) @qml.qnode(dev) def circuit(weight, wires=None): SingleExcitationUnitary(weight, wires=wires) return qml.expval(qml.PauliZ(0)) weight = 0.56 print(circuit(weight, wires=[0, 1, 2]))
Contents
Using PennyLane
Development
API
Downloads