cqft: cqft

View source: R/qft.R

cqftR Documentation

cqft

Description

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

Usage

cqft(c, x, inverse = FALSE, bits)

Arguments

c

integer. a single control qubit.

x

qstate. state the qft will applied to

inverse

boolean. If 'TRUE', perform inverse transform

bits

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

Details

Controlled 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

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


qsimulatR documentation built on Oct. 16, 2023, 5:06 p.m.