qrunch.quantum.algorithms.pauli.vqes.random_gate_selector

Module for implementing a random gate selector.

Classes

RandomGateSelector

Implementation of a gate selector that selects gates at random.

class RandomGateSelector

Bases: GateSelector

Implementation of a gate selector that selects gates at random.

__init__(seed: int) None

Initialize the RandomGateSelector.

Parameters:

seed (int) – seed for the random selection.

Return type:

None

register_gate_pool(gate_pool: GatePool) None

Register the gate pool.

Parameters:

gate_pool (GatePool) – the gate pool to register in the GateSelector. The GateSelector can only choose gates from this.

Return type:

None

select_gates(observable: HermitianPauliSum, circuit: Circuit, *, number_of_gates: int = 1) list[GatePoolOperator]

Select random gates from the gate pool.

Parameters:
  • observable (HermitianPauliSum) – IGNORED

  • circuit (Circuit) – IGNORED

  • number_of_gates (int) – Number of gates to select.

Returns:

List of gate pool operators.

Return type:

list[GatePoolOperator]