qft: qft

Description Usage Arguments Details Value Examples

View source: R/qft.R

Description

performs the quantum Fourier Trafo on the qstate x and the specified list of qubits.

Usage

1
qft(x, inverse = FALSE, bits)

Arguments

x

qstate

inverse

boolean. If 'TRUE', perform inverse transform

bits

integer. list of qubits to include in the trafo. if missing, bits=c(1:n) is assumed, with n the number of qubits in x.

Details

Quantum Fourier Trafo

The Fourier Trafo is defined as

|j> -> 1/sqrt(N) sum_k=0^N_1 exp(2 pi i j k/N) |k>

the inverse with the oposite sign in the exponential.

Value

a qstate object with the quantum Fourier trafo of input x.

Examples

1
2
3
x <- qstate(3)
y <- qft(x)
z <- qft(y, inverse=TRUE)

qsimulatR documentation built on Jan. 13, 2021, 3:13 p.m.