Representation Mappers¶
This module provides a framework for implementing custom boson-to-qubit mapper routines.
Level encodings¶
A LevelEncoding decides how the \(d\) levels of a single system are laid out on qubits.
It says nothing about what the levels are, so it is shared by every mapper that works in a basis of
discrete levels: the occupation-number basis of a truncated bosonic mode, vibrational modals, or the
points of a position grid. The mappers in library are given one as
part of a LevelSpec (see below); for example
occupation_encoding() maps a
BosonOperator in the occupation basis.
The layout of the levels of a single system on qubits. |
A LevelSpec combines a level encoding with the truncation of every mode of a register. It
holds one cutoff per mode (or one cutoff shared by all modes) and from them derives how many qubits
each mode occupies and where its qubits start, so everything that has to agree about that is handed
the same spec.
|
The truncation of a register of bosonic modes and the encoding that lays it out on qubits. |
Generator-based mappers¶
The library submodule ships the ready-made mappers. The generator
function below is the extension point for writing your own: supply the qubit operator that a single
BosonAction maps to, and it lifts that into a mapper
over whole operators.
|
Map a |