qlasskit.algorithms.grover.Grover
- class qlasskit.algorithms.grover.Grover(oracle: QlassF, element_to_search: Qtype | None = None, n_iterations: int | None = None, n_matching: int = 1)
- __init__(oracle: QlassF, element_to_search: Qtype | None = None, n_iterations: int | None = None, n_matching: int = 1)
- Parameters:
oracle (QlassF) – our f(x) -> bool that returns True if x satisfies the function or a generic function f(x) = y that we want to compare with element_to_search
element_to_search (Qtype, optional) – the element we want to search
n_iterations (int, optional) – force a number of iterations (otherwise, pi/4*sqrt(N/n_matching))
n_matching (int) – the number of expected matching values (default: 1)
Methods
__init__
(oracle[, element_to_search, ...])- param oracle:
our f(x) -> bool that returns True if x satisfies the function or
circuit
()decode_counts
(counts[, discard_lower])Decode data from a circuit counts dict
decode_output
(istr)draw
()encode_input
(*qvals)export
([framework])Export the circuit to a supported framework
gate
([framework])Returns the gate for a specific framework
Attributes
input_qubits
Returns the list of input qubits
input_size
num_gates
num_qubits
output_qubits
Returns the list of output qubits
output_size
qubits
Returns all the qubits of the circuit