qrisp.grover.diffuser#

diffuser(*args, permeability=[], is_qfree=False, verify=False, **kwargs)#

Applies the Grover diffuser onto (multiple) QuantumVariables.

Parameters
input_objectQuantumVariable or list[QuantumVariable]

The (list of) QuantumVariables to apply the Grover diffuser on.

state_functionfunction

A Python function preparing the initial state. The default is None.

Examples

We apply the Grover diffuser onto several QuantumChars:

>>> from qrisp import QuantumChar
>>> from qrisp.grover import diffuser
>>> q_ch_list = [QuantumChar(), QuantumChar(), QuantumChar()]
>>> diffuser(q_ch_list)
>>> print(q_ch_list[0].qs)
          ┌────────────┐
q_ch_0.0: ┤0           ├
          │            │
q_ch_0.1: ┤1           ├
          │            │
q_ch_0.2: ┤2           ├
          │            │
q_ch_0.3: ┤3           ├
          │            │
q_ch_0.4: ┤4           ├
          │            │
q_ch_1.0: ┤5           ├
          │            │
q_ch_1.1: ┤6           ├
          │            │
q_ch_1.2: ┤7  diffuser ├
          │            │
q_ch_1.3: ┤8           ├
          │            │
q_ch_1.4: ┤9           ├
          │            │
q_ch_2.0: ┤10          ├
          │            │
q_ch_2.1: ┤11          ├
          │            │
q_ch_2.2: ┤12          ├
          │            │
q_ch_2.3: ┤13          ├
          │            │
q_ch_2.4: ┤14          ├
          └────────────┘