Synth

class samplomatic.synths.Synth[source]

Bases: Generic[QubitT, ParameterT, InstructionT]

Base class for synthesizers.

Attributes Summary

Methods Summary

generate_template_values(register)

Generate parameter values for all gates of the register valid for this synth's template.

make_template(qubits, params)

Return a parametric template that can synthesize gates.

Attributes Documentation

compatible_register_types: frozenset[VirtualType] = frozenset({})
num_params: int = 0
num_qubits: int = 1

Methods Documentation

abstractmethod generate_template_values(register: VirtualRegister) ndarray[source]

Generate parameter values for all gates of the register valid for this synth’s template.

Parameters:

register – The data register containing the virtual gates to generate template parameter values for.

Returns:

An array of shape (register.num_subsystems, register.num_samples, num_params).

Raises:

SynthError – If the provided virtual register type is incompatible with this synth.

abstractmethod make_template(qubits: list[QubitT], params: Iterable[ParameterT]) Iterable[InstructionT][source]

Return a parametric template that can synthesize gates.

Parameters:
  • qubits – The qubits for which to make the template.

  • params – The ordered parameters to use while making the template.

Yields:

Instructions that implement the template.

Raises:

SynthError – When there is a problem synthesizing.