atlas_q.grover.BitmapOracle#

class atlas_q.grover.BitmapOracle(n_qubits, marked_states, device='cuda', dtype=torch.complex128)[source]#

Bases: OracleBase

Oracle based on explicit bitmap of marked states

More efficient than FunctionOracle for small marked sets.

Example:

oracle = BitmapOracle(n_qubits=4, marked_states={3, 7, 11})

Methods

apply(mps)

Apply oracle by marking all states in bitmap

get_marked_count()

Return number of marked items

mark(mps, state)

Mark a specific basis state by flipping its phase

__init__(n_qubits, marked_states, device='cuda', dtype=torch.complex128)[source]#

Methods

__init__(n_qubits, marked_states[, device, ...])

apply(mps)

Apply oracle by marking all states in bitmap

get_marked_count()

Return number of marked items

mark(mps, state)

Mark a specific basis state by flipping its phase

apply(mps)[source]#

Apply oracle by marking all states in bitmap

Returns:

New MPS after oracle application