Description Usage Arguments Value Examples
Probabilistically measures the input ket. By default measures all qubits, but if a list of integers is supplied it will measure only those qubits. Returns a list containing the state of the ket after measurement along with integer value of the state that was measured. Additionally, returns a vector of the measured binary values, if a list of qubits to measure was specified.
1 |
... |
The input ket to measure. Optionally followed by integers specifying which qubits of the ket to measure. Qubits indexed from 0 from right to left |
l2r |
Boolean which specifices if indexing should be performed from left to right. Is FALSE by default to maintain backwards compatibility, however all other functions index from left to right. |
A list with the first item a column vector containing normalized amplitudes of the measured ket and the second item the integer value of the state which was measured. If a list of qubits to measure was specified as an argument, there is a 3rd item in the list which is a vector of the binary measured values.
1 2 3 4 5 |
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]
[1,] 1+0i
[2,] 0+0i
[[2]]
[1] 0
[[1]]
[,1]
[1,] 0.4472136+0i
[2,] 0.8944272+0i
[3,] 0.0000000+0i
[4,] 0.0000000+0i
[[2]]
[1] 1
[[3]]
[1] 0
[[1]]
[,1]
[1,] 0.0000000+0i
[2,] 0.0000000+0i
[3,] 0.0000000+0i
[4,] 0.0000000+0i
[5,] 0.3790490+0i
[6,] 0.4548588+0i
[7,] 0.5306686+0i
[8,] 0.6064784+0i
[[2]]
[1] 7
[[3]]
[1] 1
[[1]]
[,1]
[1,] 0.0000000+0i
[2,] 0.0000000+0i
[3,] 0.0000000+0i
[4,] 0.0000000+0i
[5,] 0.6401844+0i
[6,] 0.7682213+0i
[7,] 0.0000000+0i
[8,] 0.0000000+0i
[[2]]
[1] 5
[[3]]
[1] 1 0
[[1]]
[,1]
[1,] 0+0i
[2,] 0+0i
[3,] 0+0i
[4,] 0+0i
[5,] 0+0i
[6,] 1+0i
[7,] 0+0i
[8,] 0+0i
[[2]]
[1] 5
[[3]]
[1] 1 0 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.