UniformDistribution¶
- class UniformDistribution(num_target_qubits, low=0, high=1)[source]¶
The Univariate Uniform Distribution.
Uniform distribution is defined by the number of qubits that should be used to represent the distribution, as well as the lower bound and upper bound of the considered interval.
- Parameters
num_target_qubits (
int
) – Number of qubits it acts on, has a minimum value of 1.low (
float
) – Lower bound, i.e., the value corresponding to |0…0> (assuming an equidistant grid)high (
float
) – Upper bound, i.e., the value corresponding to |1…1> (assuming an equidistant grid)
Attributes
returns high
returns low
Returns the number of target qubits
returns number of values
returns probabilities
returns values
Methods
UniformDistribution.build
(qc, q[, …])UniformDistribution.build_controlled
(qc, q, …)Adds corresponding controlled sub-circuit to given circuit
Adds controlled inverse of corresponding sub-circuit to given circuit
Adds controlled, inverse, power of corresponding circuit.
Adds controlled power of corresponding circuit.
UniformDistribution.build_inverse
(qc, q[, …])Adds inverse of corresponding sub-circuit to given circuit
Adds inverse power of corresponding circuit.
UniformDistribution.build_power
(qc, q, power)Adds power of corresponding circuit.
returns number of qubits
returns number of qubits controlled
Takes a probability density function (pdf), and returns a truncated and discretized array of probabilities corresponding to it
returns required ancillas
returns required ancillas controlled