GroverDiffusion: GroverDiffusion

Description Usage Arguments Value Examples

View source: R/GroverDiffusion.R

Description

If integer is input, returns the matrix of Grover Diffusion operation on the integer number of qubits. If ket given as input, applies a Grover Diffusion operation to the input ket and returns the resulting ket

Usage

1

Arguments

input

Either integer specifying size of operation (in number of qubits it is applied to) or input ket to apply Grover Diffusion to

Value

Either the matrix of the Grover Diffusion gate of the specified size or ket after a Grover Diffusion operation is applied

Examples

1
2
 GroverDiffusion(ket(1,1,1,1,1,1,1,1))
 GroverDiffusion(3)

Example output

Attaching package: ‘QuantumOps’

The following object is masked from ‘package:stats’:

    dist

The following objects are masked from ‘package:base’:

    I, norm, single

             [,1]
[1,] 0.3535534+0i
[2,] 0.3535534+0i
[3,] 0.3535534+0i
[4,] 0.3535534+0i
[5,] 0.3535534+0i
[6,] 0.3535534+0i
[7,] 0.3535534+0i
[8,] 0.3535534+0i
      [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]  [,8]
[1,] -0.75  0.25  0.25  0.25  0.25  0.25  0.25  0.25
[2,]  0.25 -0.75  0.25  0.25  0.25  0.25  0.25  0.25
[3,]  0.25  0.25 -0.75  0.25  0.25  0.25  0.25  0.25
[4,]  0.25  0.25  0.25 -0.75  0.25  0.25  0.25  0.25
[5,]  0.25  0.25  0.25  0.25 -0.75  0.25  0.25  0.25
[6,]  0.25  0.25  0.25  0.25  0.25 -0.75  0.25  0.25
[7,]  0.25  0.25  0.25  0.25  0.25  0.25 -0.75  0.25
[8,]  0.25  0.25  0.25  0.25  0.25  0.25  0.25 -0.75

QuantumOps documentation built on Feb. 3, 2020, 5:07 p.m.