---
title: RzRxSynth (latest version)
description: API reference for samplomatic.synths.RzRxSynth in the latest version of samplomatic
source: https://quantum.cloud.ibm.com/docs/en/api/samplomatic/auto/synths-rz-rx-synth
---

# RzRxSynth

*class* `samplomatic.synths.RzRxSynth`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/synths/rzrx_synth.py#L26-L69)

Bases: [`Synth`](/docs/api/samplomatic/auto/synths-synth "samplomatic.synths.synth.Synth")\[[`Qubit`](/docs/api/qiskit/circuit#qiskit.circuit.Qubit), [`Parameter`](/docs/api/qiskit/qiskit.circuit.Parameter), [`CircuitInstruction`](/docs/api/qiskit/qiskit.circuit.CircuitInstruction)]

Synthesizes arbitrary single-qubit gates into rz-rx-rz.

**Attributes Summary**

|                                                                                                                                                 |   |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | - |
| [`compatible_register_types`](#samplomatic.synths.RzRxSynth.compatible_register_types "samplomatic.synths.RzRxSynth.compatible_register_types") |   |
| [`num_params`](#samplomatic.synths.RzRxSynth.num_params "samplomatic.synths.RzRxSynth.num_params")                                              |   |

**Methods Summary**

|                                                                                                                                                        |                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- |
| [`generate_template_values`](#samplomatic.synths.RzRxSynth.generate_template_values "samplomatic.synths.RzRxSynth.generate_template_values")(register) | Generate parameter values for all gates of the register valid for this synth's template. |
| [`make_template`](#samplomatic.synths.RzRxSynth.make_template "samplomatic.synths.RzRxSynth.make_template")(qubits, params)                            | Return a parametric template that can synthesize gates.                                  |

**Attributes Documentation**

### compatible\_register\_types

Type: [`frozenset`](https://docs.python.org/3/builtins/stdtypes.html#frozenset)\[[`VirtualType`](/docs/api/samplomatic/auto/virtual-registers-virtual-type "samplomatic.virtual_registers.virtual_type.VirtualType")]

Default value: `frozenset({VirtualType.U2})`

### num\_params

Type: [`int`](https://docs.python.org/3/builtins/functions.html#int)

Default value: `3`

**Methods Documentation**

### generate\_template\_values

`generate_template_values(register)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/synths/rzrx_synth.py#L40-L69)

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**](/docs/api/samplomatic/auto/exceptions-synth-error "samplomatic.exceptions.SynthError") – If the provided virtual register type is incompatible with this synth.

### make\_template

`make_template(qubits, params)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/synths/rzrx_synth.py#L32-L38)

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**](/docs/api/samplomatic/auto/exceptions-synth-error "samplomatic.exceptions.SynthError") – When there is a problem synthesizing.
