Taylor Truncation

Taylor Truncation

Taylor truncation based Hamiltonian simulation (https://arxiv.org/abs/1412.4687) has many clear advantages. It has better complexity dependence on the precision and allows a greater range of Hamiltonians to be simulated.

The package provides circuits for five kinds of problems:

To simulate the following the algorithm, simulates the Taylor expansion of $e^{iHt}$ upto $k$ orders.

\[|u(t)⟩ = e^{iHt}|u(0)⟩\]

We have,

\[|x(t)\rangle \approx \sum^{k}_{m=0}\frac{||x(0)||(||M||t)^{m}}{m!}\mathcal{M}^{m}|x(0)\rangle\]

where $M = ||M||\mathcal{M} = iH$

There are two cases to consider:

  1. $\mathcal{M}$ is unitary. In addition to the vector state register, we have $T = log_{2}(k+1)$ ancillary bits. The ancilla is in $|0⟩$ to begin with. The VS1 block acts on the ancilla register to generate an appropriate superpostion
\[\sum^{k}_{m=0}\frac{||x(0)||(||M||t)^{m}}{m!} |m\rangle\]

Multiplication of $\mathcal{M}^{j}$ block is controlled by $|j⟩$ in the ancilla register. VS1', the adjoint of VS1, un-computes the ancilla registers. The desired result is obtained when the resulting state is projected onto $|0\rangle$ ancilla state.

  1. $\mathcal{M}$ is non-unitary. $\mathcal{M}$ is expressed as a linear combination of four (at most) unitary i.e. $\mathcal{M} =\sum_{i} \frac{1}{2} F_{i}$. We have two registers of sizes $k$ and $2k$.These registers participate in control-multiplications, as control bits. VS1 behaves differently to that in the unitary case. In the first register, states with $j$ $1$'s (where $j \in \{0,1,...,k\}$) are raised to probability amplitudes equal to the term with the $j^{th}$ power in the summation above, while rest of the states are given zero probability. The mappings used is $m = 2^{k} - 2^{j}$ , $m$ corresponds to the basis state in the first register. This register governs the the power $F_i$s need to be raised to. The second register is superposed by VT, where each new state corresponds to a $F_i$. When un-computed and measured in the zero ancilla state, we obtain the desired result.
TaylorParam(k::Int, t::L, H::Matrix, x::Array{CPType,1})

TaylorParam(k::Int,t::L,prob::QuLDEProblem{uType, tType, isinplace, F, P, T})

Assigns values to parameters required for Taylor series based Hamiltonian simulation.

* k : sets order of Taylor series expansion
* t : time of evolution
* H : Hamiltonian
* x : intial vector
* prob : wrapper for Linear differential equation problems (contains H, x, b)
source
circuit_ends(n::Int, blk::TaylorParam{CPType, false}, VS1::AbstractMatrix, VS2::AbstractMatrix, VT::AbstractMatrix)

Generates the part of circuit that computes and decomputes the superposition of the ancilla bits, in non-unitary H quldecircuit

source
circuit_ends(n::Int, blk::TaylorParam{CPType, false}, VS1::AbstractMatrix, VT::AbstractMatrix)

Generates the part of circuit that computes and decomputes the superposition of the ancilla bits, in non-unitary H taylorcircuit

source
circuit_ends(n::Int, blk::TaylorParam{CPType, true}, VS1::AbstractMatrix, VS2::AbstractMatrix)

Generates the part of circuit that computes and decomputes the superposition of the ancilla bits, in unitary H quldecircuit

source
circuit_ends(n::Int, blk::TaylorParam{CPType, true}, VS1::AbstractMatrix)

Generates the part of circuit that computes and decomputes the superposition of the ancilla bits, in unitary H taylorcircuit

source
circuit_intermediate(n::Int, c::Int, blk::TaylorParam{CPType, false})

Generates the intermediate part of the circuit for non-unitary H.

source
circuit_intermediate(n::Int, c::Int, blk::TaylorParam{CPType, true})

Generates the intermediate part of the circuit for unitary H.

source
taylorcircuit(n::Int, blk::TaylorParam, VS1::Matrix, VT::Matrix) ->->  ChainBlock{n}

Generates circuit for a non-unitary H input.

source
taylorcircuit(n::Int, blk::TaylorParam, VS1::Matrix) ->  ChainBlock{n}

Generates circuit for a unitary H input.

source
taylorsolve(H::Array{CPType,2}, x::Vector{CPType}, k::Int, t::Real) -> ArrayReg, CPType

Simulates a Hamiltonian using the Taylor truncation method. Returns the state register and inverse probability of finding it.

source
QuDiffEq.vMethod.
v(n::Int,c::Int, T::Int, V::AbstractMatrix) -> ChainBlock{n}

Builds T input block. n : total number of qubits V : T input matrix c : starting qubit

source
QuDiffEq.vMethod.
v(n::Int,c::Int, j::Tuple, T::Int, V::AbstractMatrix) -> ControlBlock{n}

Builds a T input, j - control block. n : total number of qubits V : T input matrix c : starting qubit j : control bits tuple

source
QuDiffEq.calc_vs1Method.
calc_vs1(blk::TaylorParam, x::Vector{CPType}, opn::Real) ->  Matrix{CPType}

Calculates VS1 block for Taylor circuit.

source
QuDiffEq.calc_vs2Method.
calc_vs2(blk::TaylorParam, x::Vector{CPType}, opn::Real) ->  Matrix{CPType}

opn: operator norm of the input matrix.

Calculates VS2 block for Taylor circuit.

source
QuDiffEq.calc_vtMethod.
calc_vt(::Type{CPType}) -> Matrix{CPType}

Generates VT block for non-unitary Taylor circuit.

source
unitary_decompose(H::Array{T,2}) -> Array{Array{T,2},1}

Generates a linear compostion of unitary matrices for argument H.

source

Quantum Linear Differential Equation

A linear differential equation is written as

\[ \frac{dx}{dt} = Mx + b\]

$M$ is an arbitrary N × N matrix, $x$ and $b$ are N dimensional vectors.

The modified version of the taylorcircuit is employed here. The transformation over $x$ is the same as in the taylorcircuit, but there is simultaneous transformation over b as well. There is an additional ancillary bit that allows the distinction between $x$ and $b$. This superpostion is brought about by V matrix. Like VS1 in taylorcircuit, VS2 facilitates the transformation on $b$ in the simulation.

quldecircuit(n::Int,blk::TaylorParam,VS1::AbstractMatrix,VS2::AbstractMatrix,VT::AbstractMatrix) -> ChainBlock{n}

Generates circuit for solving linear differental equations for a non-unitary H input.

source
quldecircuit(n::Int,blk::TaylorParam,VS1::AbstractMatrix,VS2::AbstractMatrix) -> ChainBlock{n}

Generates circuit for solving linear differental equations for a unitary H input.

source

Quantum Non-linear Differential Equation

The non-linear solver constitutes two sub-routines. Firstly, the function transform sub-routine, which employs of the taylorcircuit. The function transform lets us map $z$ to $P(z)$, where $P$ is a quadratic polynomial.

Secondly, the forward Euler method. The polynomial here is : $z + hf(z)$. $f$ is the derivative .

euler_matrix(A::Matrix{CPType},b::Vector{CPType},h::Real) -> Matrix

Generates matrix for forward Euler iteration.

source
euler_matrix(A::Matrix{CPType},b::Vector{CPType},h::Real) -> Matrix

Updates euler matrix for forward Euler iteration.

source
func_transform(A::Matrix, x::Vector, k::Int) -> ArrayReg, <: Complex

Function transform sub-routine. Returns state register and inverse probability of finding it.

source
make_hermitian(A::Matrix) -> Matrix

Returns hermitian matrix containing A.

source
make_input_vector(x::Vector{T}) -> Vector{T}

Generates input vector for QuNLDE iterations.

source