Learn R Programming

QuantumOps (version 3.0.1)

compareQuantumState: compareQuantumState

Description

Generates a matrix (quantum oracle) which will flip the last qubit in a quantum state if the qubits at indices in vectors a and b are the same

Usage

compareQuantumState(nQubits,a,b)

Arguments

nQubits

Number of qubits in a target ket. Should contain at least enough for states a and b and an additional last qubit.

a

Vector of indices of first state to compare in a target ket

b

Vector of indices of second state to compare in a target ket

Value

Matrix of the compareQuantumState oracle

Examples

Run this code
# NOT RUN {
 compareQuantumState(5,0:1,2:3)
# }

Run the code above in your browser using DataLab