R: R

Description Usage Arguments Value Examples

View source: R/R.R

Description

If no second argument is supplied, returns the matrix of an R phase gate of the specified radians. If ket given as second argument, applies the R gate to the input ket and returns the resulting ket. Is equivalent to the more recently added Rz function.

Usage

1
R(theta,...)

Arguments

theta

Radians to phase rotate the ket

...

No argument, or ket (column vector) that is input to the gate

Value

Matix of the R gate or ket after an R gate is applied

Examples

1
2
 R(pi,ket(1,0))
 R(pi)

Example output

Attaching package:QuantumOpsThe following object is masked frompackage:stats:

    dist

The following objects are masked frompackage:base:

    I, norm, single

     [,1]
[1,] 1+0i
[2,] 0+0i
     [,1]  [,2]
[1,] 1+0i  0+0i
[2,] 0+0i -1+0i

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

Related to R in QuantumOps...