Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

H₂ Molecule Jordan-Wigner Circuit Construction

Overview

The quantum circuit for simulating the H2_2 molecule using the Jordan-Wigner (JW) transformation involves mapping fermionic operators to qubit operators and implementing various excitation operators. This document provides a detailed explanation of each circuit section and its physical significance.

1. Initial State Preparation

Physical Basis

We use the STO-3G minimal basis set for H2_2, which provides:

  • 2 spatial orbitals (one for each H atom)

  • 4 spin orbitals (2 spatial × 2 spins)

  • Requires 4 qubits for encoding

Initial State

The Hartree-Fock (HF) state serves as our reference state[1]^{[1]}:

  • State: 1100|1100\rangle

  • Physical meaning: Two electrons occupying the bonding orbital (lower energy)

  • Implementation: X gates on qubits 0 and 1

2. Jordan-Wigner Transformation Overview

The Jordan-Wigner transformation maps fermionic creation and annihilation operators to qubit operators by representing them as strings of Pauli matrices. This transformation ensures that the fermionic anticommutation relations are preserved in the qubit representation.

Mapping Operators

For a system with NN spin orbitals, the mapping is:

  • Creation operator:

    aj=(k=0j1Zk)(XjiYj2)a_j^\dagger = \left( \prod_{k=0}^{j-1} Z_k \right) \left( \frac{X_j - i Y_j}{2} \right)
  • Annihilation operator:

    aj=(k=0j1Zk)(Xj+iYj2)a_j = \left( \prod_{k=0}^{j-1} Z_k \right) \left( \frac{X_j + i Y_j}{2} \right)

The k=0j1Zk\prod_{k=0}^{j-1} Z_k term, known as the Jordan-Wigner string, accounts for the anticommutation relations of fermionic operators. This string ensures that operators on different sites anticommute, as required by the Pauli exclusion principle.

3. Single Excitations

Physical Significance

Single excitations represent the promotion of an electron from an occupied molecular orbital (MO) to a virtual (unoccupied) MO. Physically, this accounts for electron correlation by allowing electrons to occupy higher energy states, leading to a more accurate description of the electronic structure.

3.1 Single Excitation ( ↑ Spin)

Operator Form

The single excitation operator T1T_1 in second quantization[2]^{[2]}:

T1=i,atia(aaai)T_1 = \sum_{i,a} t_i^a \left( a_a^\dagger a_i \right)

where:

  • aia_i is the annihilation operator for orbital ii

  • aaa_a^\dagger is the creation operator for orbital aa

  • tiat_i^a are the excitation amplitudes

Jordan-Wigner Transformation

For the 020 \rightarrow 2 excitation (↑ spin), the JW transformed operators become[3]^{[3]}:

  • Annihilation operator a0a_0:

    a0=(k=01Zk)(X0+iY02)=(X0+iY02)a_0 = \left( \prod_{k=0}^{-1} Z_k \right) \left( \frac{X_0 + i Y_0}{2} \right) = \left( \frac{X_0 + i Y_0}{2} \right)

    (Since the product from k=0k=0 to -1 is empty, the JW string is identity.)

  • Creation operator a2a_2^\dagger:

    a2=(k=01Zk)(X2iY22)=Z0Z1(X2iY22)a_2^\dagger = \left( \prod_{k=0}^{1} Z_k \right) \left( \frac{X_2 - i Y_2}{2} \right) = Z_0 Z_1 \left( \frac{X_2 - i Y_2}{2} \right)

Implementation in Circuit

Implementation consists of:

  1. Initial rotation: Ry(θ2)R_y\left( \frac{\theta}{2} \right) on target qubit (qubit 2)

  2. Forward JW string: CNOT ladder implementing ZZ-string from qubit 0 to qubit 2

  3. Phase rotation: Rz(θ)R_z(\theta) on qubit 2, with basis change using XX gates if necessary

  4. Reverse JW string: Inverse CNOT ladder to undo the JW string

  5. Final rotation: Ry(θ2)R_y\left( -\frac{\theta}{2} \right) on target qubit (qubit 2)

Implementing JW Strings Using CNOT Gates

The JW strings are implemented using CNOT gates to propagate the required ZZ operators:

  • Forward JW String:

    • Apply CNOT gates from qubit kk to qubit k+1k+1 for k=0k = 0 to 1

  • Reverse JW String:

    • Apply CNOT gates from qubit kk to qubit k1k-1 for k=2k = 2 down to 1

This sequence effectively creates the required ZZ operators between the qubits involved in the excitation.

3.2 Single Excitation (↓ Spin)

Similar to the (↑ spin excitation but for the 131 \rightarrow 3 transition:

  • Operates on different qubits (1 and 3)

  • Maintains spin symmetry

  • Uses the same mathematical structure as ( ↑ spin excitation)

Operator Form

For the 131 \rightarrow 3 excitation (↓ spin):

  • Annihilation operator a1a_1:

    a1=(X1+iY12)a_1 = \left( \frac{X_1 + i Y_1}{2} \right)
  • Creation operator a3a_3^\dagger:

    a3=(k=02Zk)(X3iY32)=Z0Z1Z2(X3iY32)a_3^\dagger = \left( \prod_{k=0}^{2} Z_k \right) \left( \frac{X_3 - i Y_3}{2} \right) = Z_0 Z_1 Z_2 \left( \frac{X_3 - i Y_3}{2} \right)

Implementation in Circuit

Implementation steps are analogous to the (↑ spin excitation, applied to qubits 1 and 3.

4. Double Excitation

Physical Significance

Double excitations involve the simultaneous excitation of two electrons from occupied to virtual MOs. They capture the correlated motion of electron pairs, which is essential for accurately modeling systems with significant electron correlation effects.

Operator Form

The double excitation operator T2T_2 in second quantization:

T2=i,j,a,btijab(aaabajai)T_2 = \sum_{i,j,a,b} t_{ij}^{ab} \left( a_a^\dagger a_b^\dagger a_j a_i \right)

Implementation Details

For the 01→23 double excitation:

  1. Initial preparation: Simultaneous Ry(θ/2)R_y(\theta/2) on qubits 2 and 3

  2. JW string implementation: Extended CNOT ladder for multiple qubits

  3. Phase rotation: Single Rz(θ)R_z(\theta) application

  4. Reverse operations: Maintaining unitarity

5. Physical Significance

The complete circuit implements the Unitary Coupled Cluster (UCC) ansatz[4]^{[4]}:

ψ(θ)=eTTHF|\psi(\theta)\rangle = e^{T - T^\dagger} | \text{HF} \rangle

where:

  • T=T1+T2T = T_1 + T_2

  • T1T_1 represents single excitations

  • T2T_2 represents double excitations

The UCC ansatz allows for the incorporation of electron correlation effects by considering excitations from the reference state to excited states, weighted by parameters θ\theta.

6. Circuit Parameters

The three parameters (θ1\theta_1, θ2\theta_2, θ3\theta_3) control:

  1. θ1\theta_1: Amplitude of (\uparrow) spin single excitation

  2. θ2\theta_2: Amplitude of (\downarrow) spin single excitation

  3. θ3\theta_3: Amplitude of double excitation

These parameters are typically optimized variationally to find the ground state energy.

Optimization of Parameters

In the Variational Quantum Eigensolver (VQE) framework, these parameters are adjusted to minimize the expectation value of the Hamiltonian:

E(θ)=ψ(θ)Hψ(θ)E(\vec{\theta}) = \langle \psi(\vec{\theta}) | H | \psi(\vec{\theta}) \rangle

The optimization is performed using classical algorithms, such as gradient descent or the Nelder-Mead method. The objective is to find the parameter set θ\vec{\theta} that yields the lowest possible energy, corresponding to the ground state of the molecule.

7. Implementation Considerations

Spin Symmetry and Antisymmetry

  • Spin Symmetry: Maintained by treating spin-up and spin-down orbitals separately and performing excitations within the same spin manifold.

  • Antisymmetry: The JW transformation preserves the antisymmetric nature of the fermionic wavefunction under particle exchange through the use of JW strings.

Computational Complexity

  • Gate Depth: The JW transformation can result in long strings of ZZ operators, leading to circuits with many CNOT gates.

  • Scalability: The number of gates increases with the number of orbitals, making it challenging to simulate larger molecules.

  • Alternative Transformations: Methods like the Bravyi-Kitaev transformation can reduce the number of required gates by balancing locality and parity encoding.

Error Mitigation Techniques

In practical quantum computations, errors due to decoherence and gate imperfections can significantly affect results. Common error mitigation techniques include:

  • Zero-Noise Extrapolation: Running the circuit at different noise levels and extrapolating to zero noise.

  • Symmetry Verification: Using conserved quantities, like particle number or spin, to detect and correct errors.

  • Subspace Expansion: Expanding the variational ansatz to include error states and projecting back onto the physical subspace.

8. Circuit Diagrams

Note: Visual diagrams cannot be included in this text format. In practice, you should include circuit diagrams illustrating the following sections:

  • Initial State Preparation: Show the application of XX gates on qubits 0 and 1.

  • Single Excitation Circuits: Depict the sequence of gates for the 020 \rightarrow 2 and 131 \rightarrow 3 excitations, including the CNOT ladders and rotation gates.

  • Double Excitation Circuit: Illustrate the circuit involving multiple qubits and controlled operations.

9. Conlusion

By incorporating detailed explanations of the Jordan-Wigner transformation, implementation of JW strings using CNOT gates, and the physical significance of excitations, we gain a deeper understanding of simulating the H₂ molecule on a quantum computer. Additionally, considering computational complexities and error mitigation techniques provides insight into practical challenges and solutions in quantum simulations.

References

[1]^{[1]}: Helgaker, T., Jorgensen, P., & Olsen, J. (2014). Molecular Electronic-Structure Theory. John Wiley & Sons.

[2]^{[2]}: Szabo, A., & Ostlund, N. S. (2012). Modern Quantum Chemistry: Introduction to Advanced Electronic Structure Theory. Dover Publications.

[3]^{[3]}: Jordan, P., & Wigner, E. (1928). Über das Paulische Äquivalenzverbot. Zeitschrift für Physik, 47(9-10), 631-651.

[4]^{[4]}: Romero, J., et al. (2019). Strategies for quantum computing molecular energies using the unitary coupled cluster ansatz. Quantum Science and Technology, 4(1), 014008.

Additional References:

  • McArdle, S., Endo, S., Aspuru-Guzik, A., Benjamin, S. C., & Yuan, X. (2020). Quantum computational chemistry. Reviews of Modern Physics, 92(1), 015003.

  • Kandala, A., et al. (2017). Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets. Nature, 549(7671), 242-246.

  • Bravyi, S., & Kitaev, A. (2002). Fermionic quantum computation. Annals of Physics, 298(1), 210-226.

from qiskit import QuantumCircuit
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
from qiskit_ibm_runtime import QiskitRuntimeService, SamplerV2 as Sampler

service = QiskitRuntimeService()

# 1. A quantum circuit for preparing the quantum state (|00> + |11>)/rt{2}
bell = QuantumCircuit(2)
bell.h(0)
bell.cx(0, 1)
bell.measure_all()

# 2: Optimize problem for quantum execution.
backend = service.least_busy(operational=True, simulator=False)
pm = generate_preset_pass_manager(backend=backend, optimization_level=1)
isa_circuit = pm.run(bell)

# 3. Execute using the Sampler primitive
sampler = Sampler(mode=backend)
sampler.options.default_shots = 1024  # Options can be set using auto-complete.
job = sampler.run([isa_circuit])
print(f"Job ID is {job.job_id()}")
pub_result = job.result()[0]
print(f"Counts for the meas output register: {pub_result.data.meas.get_counts()}")
Job ID is cw3k0e1vka8g008bgbeg
Counts for the meas output register: {'00': 407, '11': 517, '01': 53, '10': 47}
from qiskit import QuantumCircuit, QuantumRegister
import numpy as np

def create_h2_jordan_wigner_circuit(parameters):
    """
    Creates a quantum circuit for H2 molecule using Jordan-Wigner transformation
    with clear visual breaks between different sections
    Args:
        parameters (list): List of parameters for the ansatz [theta1, theta2, theta3]
    Returns:
        QuantumCircuit: The prepared circuit
    """
    # Initialize quantum registers
    qr = QuantumRegister(4, 'q')
    circuit = QuantumCircuit(qr)
    
    # Section 1: Initial state preparation (Hartree-Fock state |1100⟩)
    circuit.x(qr[0])
    circuit.x(qr[1])
    circuit.barrier(label='Initial HF State |1100⟩')
    
    # Section 2: Single excitation 0->2 (↑ spin)
    circuit.ry(parameters[0]/2, qr[2])
    # Forward CNOT ladder
    circuit.cx(qr[2], qr[1])
    circuit.cx(qr[1], qr[0])
    circuit.barrier(label='↑ Forward JW string')
    
    # Phase rotation
    circuit.x(qr[0])
    circuit.rz(parameters[0], qr[0])
    circuit.x(qr[0])
    circuit.barrier(label='↑ Phase rotation')
    
    # Reverse CNOT ladder
    circuit.cx(qr[1], qr[0])
    circuit.cx(qr[2], qr[1])
    circuit.ry(-parameters[0]/2, qr[2])
    circuit.barrier(label='↑ Reverse JW string')
    
    # Section 3: Single excitation 1->3 (↓ spin)
    circuit.ry(parameters[1]/2, qr[3])
    # Forward CNOT ladder
    circuit.cx(qr[3], qr[2])
    circuit.cx(qr[2], qr[1])
    circuit.barrier(label='↓ Forward JW string')
    
    # Phase rotation
    circuit.x(qr[1])
    circuit.rz(parameters[1], qr[1])
    circuit.x(qr[1])
    circuit.barrier(label='↓ Phase rotation')
    
    # Reverse CNOT ladder
    circuit.cx(qr[2], qr[1])
    circuit.cx(qr[3], qr[2])
    circuit.ry(-parameters[1]/2, qr[3])
    circuit.barrier(label='↓ Reverse JW string')
    
    # Section 4: Double excitation 01->23
    circuit.ry(parameters[2]/2, qr[2])
    circuit.ry(parameters[2]/2, qr[3])
    circuit.barrier(label='Double excitation preparation')
    
    # Forward CNOT ladder
    circuit.cx(qr[3], qr[2])
    circuit.cx(qr[2], qr[1])
    circuit.cx(qr[1], qr[0])
    circuit.barrier(label='Double Forward JW string')
    
    # Phase rotation
    circuit.rz(parameters[2], qr[0])
    circuit.barrier(label='Double Phase rotation')
    
    # Reverse CNOT ladder
    circuit.cx(qr[1], qr[0])
    circuit.cx(qr[2], qr[1])
    circuit.cx(qr[3], qr[2])
    circuit.barrier(label='Double Reverse JW string')
    
    # Final rotations
    circuit.ry(-parameters[2]/2, qr[2])
    circuit.ry(-parameters[2]/2, qr[3])
    circuit.barrier(label='Final state')
    
    return circuit

# Example usage with visual output
parameters = [0.1, 0.2, 0.3]
circuit = create_h2_jordan_wigner_circuit(parameters)
circuit.draw('latex')
print(circuit)
     ┌───┐ Initial HF State |1100⟩                  ┌───┐ ↑ Forward JW string »
q_0: ┤ X ├────────────░─────────────────────────────┤ X ├──────────░──────────»
     ├───┤            ░                        ┌───┐└─┬─┘          ░          »
q_1: ┤ X ├────────────░────────────────────────┤ X ├──■────────────░──────────»
     └───┘            ░            ┌──────────┐└─┬─┘               ░          »
q_2: ─────────────────░────────────┤ Ry(0.05) ├──■─────────────────░──────────»
                      ░            └──────────┘                    ░          »
q_3: ─────────────────░────────────────────────────────────────────░──────────»
                      ░                                            ░          »
«     ┌───┐┌─────────┐┌───┐ ↑ Phase rotation ┌───┐                  »
«q_0: ┤ X ├┤ Rz(0.1) ├┤ X ├────────░─────────┤ X ├──────────────────»
«     └───┘└─────────┘└───┘        ░         └─┬─┘┌───┐             »
«q_1: ─────────────────────────────░───────────■──┤ X ├─────────────»
«                                  ░              └─┬─┘┌───────────┐»
«q_2: ─────────────────────────────░────────────────■──┤ Ry(-0.05) ├»
«                                  ░                   └───────────┘»
«q_3: ─────────────────────────────░────────────────────────────────»
«                                  ░                                »
«      ↑ Reverse JW string                       ↓ Forward JW string      »
«q_0: ──────────░─────────────────────────────────────────░───────────────»
«               ░                          ┌───┐          ░          ┌───┐»
«q_1: ──────────░──────────────────────────┤ X ├──────────░──────────┤ X ├»
«               ░                     ┌───┐└─┬─┘          ░          └───┘»
«q_2: ──────────░─────────────────────┤ X ├──■────────────░───────────────»
«               ░          ┌─────────┐└─┬─┘               ░               »
«q_3: ──────────░──────────┤ Ry(0.1) ├──■─────────────────░───────────────»
«               ░          └─────────┘                    ░               »
«                      ↓ Phase rotation                       »
«q_0: ────────────────────────░───────────────────────────────»
«     ┌─────────┐┌───┐        ░         ┌───┐                 »
«q_1: ┤ Rz(0.2) ├┤ X ├────────░─────────┤ X ├─────────────────»
«     └─────────┘└───┘        ░         └─┬─┘┌───┐            »
«q_2: ────────────────────────░───────────■──┤ X ├────────────»
«                             ░              └─┬─┘┌──────────┐»
«q_3: ────────────────────────░────────────────■──┤ Ry(-0.1) ├»
«                             ░                   └──────────┘»
«      ↓ Reverse JW string              Double excitation preparation      »
«q_0: ──────────░─────────────────────────────────────░────────────────────»
«               ░                                     ░                    »
«q_1: ──────────░─────────────────────────────────────░────────────────────»
«               ░          ┌──────────┐               ░               ┌───┐»
«q_2: ──────────░──────────┤ Ry(0.15) ├───────────────░───────────────┤ X ├»
«               ░          ├──────────┤               ░               └─┬─┘»
«q_3: ──────────░──────────┤ Ry(0.15) ├───────────────░─────────────────■──»
«               ░          └──────────┘               ░                    »
«          ┌───┐ Double Forward JW string ┌─────────┐ Double Phase rotation »
«q_0: ─────┤ X ├────────────░─────────────┤ Rz(0.3) ├───────────░───────────»
«     ┌───┐└─┬─┘            ░             └─────────┘           ░           »
«q_1: ┤ X ├──■──────────────░───────────────────────────────────░───────────»
«     └─┬─┘                 ░                                   ░           »
«q_2: ──■───────────────────░───────────────────────────────────░───────────»
«                           ░                                   ░           »
«q_3: ──────────────────────░───────────────────────────────────░───────────»
«                           ░                                   ░           »
«     ┌───┐           Double Reverse JW string               Final state 
«q_0: ┤ X ├──────────────────────░────────────────────────────────░──────
«     └─┬─┘┌───┐                 ░                                ░      
«q_1: ──■──┤ X ├─────────────────░────────────────────────────────░──────
«          └─┬─┘┌───┐            ░             ┌───────────┐      ░      
«q_2: ───────■──┤ X ├────────────░─────────────┤ Ry(-0.15) ├──────░──────
«               └─┬─┘            ░             ├───────────┤      ░      
«q_3: ────────────■──────────────░─────────────┤ Ry(-0.15) ├──────░──────
«                                ░             └───────────┘      ░