innerProduct: Inner product of 2 vectors and computes the angle between...

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/innerProduct.R

Description

This function performs a inner product of 2 vectors and outputs the angle between vectors

Usage

1

Arguments

a

Vector 1

b

Vector 2

Value

theta The angle between the vectors

Note

Maintainer: Tinniam V Ganesh [email protected]

Author(s)

Tinniam V Ganesh

References

https://quantumexperience.ng.bluemix.net/
https://gigadom.wordpress.com/2016/06/23/introducing-qcsimulator-a-5-qubit-quantum-computing-simulator-in-r/

See Also

CNOT2_10
PauliX
measurement
plotMeasurement
CNOT5_03
CNOT5_13

Examples

1
2
3
4
5
# Initialze global variables
init()
phi = matrix(c(1/2,sqrt(3)/2),nrow=2,ncol=1)
si = matrix(c(1/sqrt(2),1/sqrt(2)),nrow=2,ncol=1)
innerProduct(phi,si)

QCSimulator documentation built on May 29, 2017, 11:18 p.m.