MCPcopy Create free account

hub / github.com/beneills/quantum / functions

Functions117 in github.com/beneills/quantum

↓ 10 callersMethodget
Get the element in position `(i, j)`.
src/matrix.rs:164
↓ 8 callersMethodset
Set the element in position `(i, j)` to `value`.
src/matrix.rs:169
↓ 6 callersMethodembed
Embed another matrix into this one, overrising elements. Embed with top-left position at (i, j). # Panics We panic if this matrix isn't large enoug
src/matrix.rs:89
↓ 6 callersFunctionidentity
(width: usize)
src/gates.rs:11
↓ 5 callersMethodapply
Apply a quantum gate to this ket, mutating its state.
src/ket.rs:94
↓ 5 callersFunctionhadamard
(n: usize)
src/gates.rs:22
↓ 5 callersMethodinitialize
Initialize the quantum register qubits to a certian classical integer state. # Panics We panic if the state is anything other than `State::Initializ
src/computer.rs:52
↓ 4 callersFunctioncontrolled
(u: &Matrix)
src/gates.rs:157
↓ 4 callersMethodmatrix
Representative matrix.
src/gate.rs:49
↓ 4 callersMethodpow
Compute an integer power of this number efficiently with repeated squaring.
src/complex.rs:63
↓ 3 callersMethodcollapse
Collapse the quantum register to a classical state. # Panics We panic if the state is anything other than `State::Running`.
src/computer.rs:77
↓ 3 callersMethodcollapse
Collapse the register to yield one a classical state. A register may only be collapsed once, and is invalid thereafter.
src/registers.rs:70
↓ 3 callersMethodnorm_sqr
Compute the square of the norm/absolute value, i.e. _|z|^2_.
src/complex.rs:58
↓ 2 callersMethodapply
Apply a quantum gate to the quantum register qubits. # Panics We panic if the state is anything other than `State::Running`.
src/computer.rs:66
↓ 2 callersMethodim
The imaginary part.
src/complex.rs:101
↓ 2 callersMethodpermute_rows
Permute the rows to generate a new matrix. Row _i_ goes to row _perutation[i]_. # Panics We panic if set(permutation) != {0, ..., self.size - 1}.
src/matrix.rs:108
↓ 2 callersMethodre
The real part.
src/complex.rs:96
↓ 2 callersMethodstate
Compute the current `state` of the register. The `state` is an integer which uniquely specifies all register bits (for a given width). It does this
src/registers.rs:248
↓ 2 callersMethodvalue
Read the collapsed register qubits as an integer. # Panics We panic if the state is anything other than `State::Collapsed`.
src/computer.rs:99
↓ 1 callersMethodapply
Apply a quantum gate to this register, mutating its state.
src/registers.rs:60
↓ 1 callersFunctioncontrolled_not
()
src/gates.rs:139
↓ 1 callersFunctiondeutsch_gate
Takes |a, b> to |a, b+f(a)> f must be a function from {0, 1} to {0, 1}
src/algorithms/deutsch.rs:20
↓ 1 callersFunctionpauli_x
()
src/gates.rs:49
↓ 1 callersFunctionpauli_y
()
src/gates.rs:61
↓ 1 callersFunctionpauli_z
()
src/gates.rs:75
↓ 1 callersMethodpermute
Permute the qubits on which we act. Qubit _i_ will be acted on as qubit _permutation[i]_ was before. TODO: The consumer has to work out the (complic
src/gate.rs:63
↓ 1 callersMethodpermute_columns
Permute the columns to generate a new matrix. Column _i_ goes to column _perutation[i]_. # Panics We panic if set(permutation) != {0, ..., self.siz
src/matrix.rs:130
↓ 1 callersFunctionquantum_fourier_transform
(n: usize)
src/gates.rs:239
↓ 1 callersMethodreset
Reset the quantum register, ready to be initialized again. # Panics We panic if the state is anything other than `State::Collapsed`.
src/computer.rs:90
↓ 1 callersMethodto_int
Return the integer represented by this register. See the `state()` method documentation for details of the encoding.
src/registers.rs:263
↓ 1 callersMethodwidth
Width of the gate.
src/gate.rs:44
Methodadd
(self, rhs: &'a Matrix)
src/matrix.rs:221
Methodadd
(self, rhs: Complex)
src/complex.rs:119
Methodadd_assign
(&mut self, rhs: Complex)
src/complex.rs:134
Methodapprox_eq
Approximately equal test.
src/matrix.rs:174
Methodapprox_eq
Approximately equal test.
src/complex.rs:106
Functionbad_column_permutation_test
()
src/matrix.rs:343
Functionbad_initialization_test
()
src/other.rs:107
Functionbad_row_permutation_test
()
src/matrix.rs:335
Functionbalanced1
(x: i32)
src/algorithms/deutsch.rs:79
Functionbalanced2
(x: i32)
src/algorithms/deutsch.rs:85
Functionclassical_test
()
src/ket.rs:115
Functioncollapse_test
()
src/registers.rs:126
Functioncomplex_test
()
src/complex.rs:160
Functioncompute_test
()
src/computer.rs:135
Functionconstant1
(x: i32)
src/algorithms/deutsch.rs:67
Functionconstant2
(x: i32)
src/algorithms/deutsch.rs:73
Functioncontrolled_not_test
()
src/gates.rs:379
Functioncontrolled_test
()
src/gates.rs:398
Functioncontrolled_x
()
src/gates.rs:175
Functioncontrolled_y
()
src/gates.rs:184
Functioncontrolled_z
()
src/gates.rs:193
Functiondeutsch_algorithm
(f: fn(i32) -> i32)
src/algorithms/deutsch.rs:46
Functiondeutsch_test
()
src/algorithms/deutsch.rs:66
Functiondouble_collapse_test
()
src/registers.rs:139
Functionembed_test
()
src/matrix.rs:313
Methodeq
(&self, other: &Matrix)
src/matrix.rs:205
Methodfmt
(&self, f: &mut fmt::Formatter)
src/matrix.rs:192
Methodfmt
(&self, f: &mut fmt::Formatter)
src/complex.rs:154
Functionfredkin
()
src/gates.rs:223
Functionfredkin_test
()
src/gates.rs:424
Methodfrom_classical
Generate a ket from a classical register. This ket encodes a single basis vector, and is used for initializing a quantum register to an initial (clas
src/ket.rs:43
Functionfrom_classical_test
()
src/ket.rs:137
Methodfrom_int
Construct a new non-quantum register, given an unsigned integer. See the `state()` method documentation for details of the encoding. # Panics We as
src/registers.rs:222
Methodfrom_state
Construct a new non-quantum register, given a `state`. See the `state()` method documentation for details of the encoding. # Panics We assert that
src/registers.rs:192
Functionhadamard_test
()
src/gates.rs:285
Methodi
The imaginary unit.
src/complex.rs:53
Methodidentity
Construct a new identity matrix of given size. # Panics We panic if the given size exceeds `MAX_SIZE`.
src/matrix.rs:67
Functionidentity_test
()
src/gates.rs:270
Functioninitialization_test
()
src/other.rs:92
Functioninitialization_test
()
src/registers.rs:116
Methodis_classical
(&self)
src/ket.rs:68
Methodis_valid
(&self)
src/ket.rs:53
Functionmatrix_test
()
src/matrix.rs:292
Methodmul
(self, rhs: &Matrix)
src/matrix.rs:239
Methodmul
(self, rhs: Complex)
src/complex.rs:127
Methodmul_assign
(&mut self, rhs: Complex)
src/complex.rs:140
Methodneg
(self)
src/complex.rs:148
Methodnew
Construct a new quantum computer with register of given `width`.
src/computer.rs:38
Methodnew
Construct a new quantum gate, given `width` and computational basis matrix. Currently we do not check whether the matrix is unitary. # Panics We pa
src/gate.rs:32
Methodnew
Construct a new, zero-initialized ket of given size.
src/ket.rs:32
Methodnew
Safely construct a qubit, given the real and imaginary parts of both coefficients. This function validates that the given state is possible.
src/other.rs:56
Methodnew
Construct a new zero-initialized matrix of given size. # Panics We panic if the given size exceeds `MAX_SIZE`.
src/matrix.rs:35
Methodnew
Construct a new quantum register of given `width` and initial state. # Panics We panic if the initial state register has a different size to `width`
src/registers.rs:49
Methodnew
Construct a new complex number as `re + im * i` with 64-bit float parts.
src/complex.rs:20
Methodnew_euler
Construct a new complex number as `r * exp(i * phi)` with 64-bit float parts.
src/complex.rs:25
Methodnew_from_elements
Construct a new matrix of given size from elements. # Panics We panic if the given size exceeds `MAX_SIZE`.
src/matrix.rs:49
Methodnth_root_of_unity
Construct a new primitive nth root of unity.
src/complex.rs:33
Methodone
One in the complex plane, i.e. `1 + 0i`.
src/complex.rs:48
Functionpauli_x_test
()
src/gates.rs:300
Functionpauli_y_test
()
src/gates.rs:313
Functionpauli_z_test
()
src/gates.rs:326
Functionpermutation_test
()
src/gates.rs:458
Functionpermutation_test
()
src/matrix.rs:323
Methodpermutation_valid
Tests whether the permutation is valid.
src/matrix.rs:146
Functionphase_shift
(phi: f64)
src/gates.rs:87
Functionphase_shift_test
()
src/gates.rs:339
Methodprobabilities
Compute the probabilities of each register state without collapsing. This function is intended for test purposes. We return a vector of probabilitie
src/computer.rs:110
Methodprobabilities
Compute the probabilities of each state without collapsing. This function is intended for test purposes. We return a vector of probabilities mirrori
src/registers.rs:102
Functionprobabilities_test
()
src/computer.rs:150
next →1–100 of 117, ranked by callers