Skip to content

qiu_hamiltonian_simulation.time_independent.sample_based

Time evolution under arbitrary potentials and kinetic energies, sample-based.

The evolution e^(-i t H / hbar) under a potential V(x) or a kinetic energy T(p) of one sign is applied by the sample-based phase propagator of qiu_quantum_computing.phase_propagator.sample_based, on the signal -t V / hbar or -t T / hbar.

Classes:

PotentialEvolutionSampleBased

PotentialEvolutionSampleBased(V: SampledSignal, t: float, hbar: float, max_delta: float, state_preparation_method: SynthesisMethod = GATE)

Bases: QuantumCircuit

The evolution e^(-i t V(x) / hbar) under a potential of one sign.

Parameters:

  • V (SampledSignal) –

    The potential, a real signal of one sign on a position axis of 2**n samples.

  • t (float) –

    The evolution time.

  • hbar (float) –

    The reduced Planck constant, in the units of V and t.

  • max_delta (float) –

    The maximum phase per cycle of the phase propagator.

  • state_preparation_method (SynthesisMethod, default: GATE ) –

    How the preparation of |phi> in the phase propagator is represented.

Attributes:

Source code in packages/qiu-hamiltonian-simulation/src/qiu_hamiltonian_simulation/time_independent/sample_based.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
def __init__(
    self,
    V: SampledSignal,
    t: float,
    hbar: float,
    max_delta: float,
    state_preparation_method: SynthesisMethod = SynthesisMethod.GATE,
) -> None:
    """Initialize the evolution.

    Args:
        V: The potential, a real signal of one sign on a position axis of `2**n`
            samples.
        t: The evolution time.
        hbar: The reduced Planck constant, in the units of `V` and `t`.
        max_delta: The maximum phase per cycle of the phase propagator.
        state_preparation_method: How the preparation of `|phi>` in the phase
            propagator is represented.
    """
    require_position_domain_axis(V.axis)
    psi_reg, phi_reg, success_flag = propagator_registers(num_qubits_of(V.axis))
    super().__init__(psi_reg, phi_reg, success_flag, name="Potential Evolution")

    propagator = QuadraticSignalSampleBasedPhasePropagator(
        signal=(-t / hbar) * V,
        max_delta=max_delta,
        method=state_preparation_method,
    )
    self.num_of_cycles = propagator.num_of_cycles
    self.compose(propagator, inplace=True)

num_of_cycles instance-attribute

num_of_cycles: int = propagator.num_of_cycles

The number of cycles of the phase propagator.

KineticEvolutionSampleBased

KineticEvolutionSampleBased(T: SampledSignal, t: float, hbar: float, max_delta: float, state_preparation_method: SynthesisMethod = GATE, fourier_method: SynthesisMethod = GATE)

Bases: QuantumCircuit

The evolution e^(-i t T(p) / hbar) under a kinetic energy of one sign.

Parameters:

  • T (SampledSignal) –

    The kinetic energy, a real signal of one sign on a Fourier domain axis of 2**n samples in the FFT ordering.

  • t (float) –

    The evolution time.

  • hbar (float) –

    The reduced Planck constant, in the units of T and t.

  • max_delta (float) –

    The maximum phase per cycle of the phase propagator.

  • state_preparation_method (SynthesisMethod, default: GATE ) –

    How the preparation of |phi> in the phase propagator is represented.

  • fourier_method (SynthesisMethod, default: GATE ) –

    How the Fourier transforms are represented.

Attributes:

Source code in packages/qiu-hamiltonian-simulation/src/qiu_hamiltonian_simulation/time_independent/sample_based.py
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
def __init__(
    self,
    T: SampledSignal,
    t: float,
    hbar: float,
    max_delta: float,
    state_preparation_method: SynthesisMethod = SynthesisMethod.GATE,
    fourier_method: SynthesisMethod = SynthesisMethod.GATE,
) -> None:
    """Initialize the evolution.

    Args:
        T: The kinetic energy, a real signal of one sign on a Fourier domain axis
            of `2**n` samples in the `FFT` ordering.
        t: The evolution time.
        hbar: The reduced Planck constant, in the units of `T` and `t`.
        max_delta: The maximum phase per cycle of the phase propagator.
        state_preparation_method: How the preparation of `|phi>` in the phase
            propagator is represented.
        fourier_method: How the Fourier transforms are represented.
    """
    require_momentum_domain_axis(T.axis)
    num_qubits = num_qubits_of(T.axis)
    psi_reg, phi_reg, success_flag = propagator_registers(num_qubits)
    super().__init__(psi_reg, phi_reg, success_flag, name="Kinetic Evolution")

    propagator = QuadraticSignalSampleBasedPhasePropagator(
        signal=(-t / hbar) * T,
        max_delta=max_delta,
        method=state_preparation_method,
    )
    self.num_of_cycles = propagator.num_of_cycles

    self.compose(
        to_momentum_basis(num_qubits, fourier_method), psi_reg, inplace=True
    )
    self.compose(propagator, inplace=True)
    self.compose(
        to_position_basis(num_qubits, fourier_method), psi_reg, inplace=True
    )

num_of_cycles instance-attribute

num_of_cycles: int = propagator.num_of_cycles

The number of cycles of the phase propagator.