Skip to content

Pulser

The Pulser backend features a basic integration with the pulse-level programming interface Pulser. This backend offers for now few simple operations which are translated into a valid, non time-dependent pulse sequence. In particular, one has access to:

  • analog rotations: AnalogRx and AnalogRy blocks
  • free evolution blocks (basically no pulse, just interaction): AnalogWait block
  • a block for creating entangled states: AnalogEntanglement
  • digital rotation Rx and Ry

Backend(name=BackendName.PULSER, supports_ad=False, support_bp=False, supports_adjoint=False, is_remote=False, with_measurements=True, native_endianness=Endianness.BIG, engine=Engine.TORCH, with_noise=False, config=Configuration()) dataclass

Bases: Backend

The Pulser backend.

_convert_init_state(state)

Flip and squeeze initial state consistent with Pulser convention.

Source code in qadence/backends/pulser/backend.py
def _convert_init_state(state: Tensor) -> np.ndarray:
    """Flip and squeeze initial state consistent with Pulser convention."""
    if state.shape[0] > 1:
        raise ValueError("Pulser backend only supports initial states with batch size 1.")
    return np.flip(state.cpu().squeeze().numpy())

create_register(register)

Convert Qadence Register to Pulser Register.

Source code in qadence/backends/pulser/backend.py
def create_register(register: Register) -> PulserRegister:
    """Convert Qadence Register to Pulser Register."""
    coords = np.array(list(register.coords.values()))
    return PulserRegister.from_coordinates(coords)