Learn R Programming

QuantumOps (version 3.0.1)

tensor: tensor

Description

Takes all arguments and combines them as a tensor product. Can be used to create a unified vector that represents multiple qubits or to create higher dimensional gates. If the inputs are two n-dimensional kets, the output is a 2-n dimensional ket representing the combined system.

Usage

tensor(...)

Arguments

...

kets (column vectosr) or gates (matrices) to take tensor product of

Value

The tensor product of all supplied arguments

Examples

Run this code
# NOT RUN {
 tensor(ket(1,0),ket(0,1),ket(1,0),ket(1,0))
 tensor(ket(1,1,1,1),ket(1,0,0,1))
 tensor(X(),I())
 tensor(H(),H(),H())
# }

Run the code above in your browser using DataLab