---
title: RGQFTMultiplier (v2.3)
description: API reference for qiskit.circuit.library.RGQFTMultiplier in qiskit v2.3
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/2.3/qiskit.circuit.library.RGQFTMultiplier
---

# RGQFTMultiplier

*class* `qiskit.circuit.library.RGQFTMultiplier(num_state_qubits, num_result_qubits=None, name='RGQFTMultiplier')`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.3/qiskit/circuit/library/arithmetic/multipliers/rg_qft_multiplier.py#L25-L109)

Bases: `Multiplier`

A QFT multiplication circuit to store product of two input registers out-of-place.

Multiplication in this circuit is implemented using the procedure of Fig. 3 in \[1], where weighted sum rotations are implemented as given in Fig. 5 in \[1]. The QFT is used on the output register and is followed by rotations controlled by input registers. The rotations transform the state into the product of two input registers in the QFT basis, which is reverted from the QFT basis using the inverse QFT.

As an example, a circuit that performs a modular QFT multiplication on two 2-qubit sized input registers with an output register of 2 qubits, is as follows:

```text
  a_0: ────────────────────────────────────────■───────■──────■──────■────────────────
                                               │       │      │      │
  a_1: ─────────■───────■───────■───────■──────┼───────┼──────┼──────┼────────────────
                │       │       │       │      │       │      │      │
  b_0: ─────────┼───────┼───────■───────■──────┼───────┼──────■──────■────────────────
                │       │       │       │      │       │      │      │
  b_1: ─────────■───────■───────┼───────┼──────■───────■──────┼──────┼────────────────
       ┌──────┐ │P(4π)  │       │P(2π)  │      │P(2π)  │      │P(π)  │       ┌───────┐
out_0: ┤0     ├─■───────┼───────■───────┼──────■───────┼──────■──────┼───────┤0      ├
       │  qft │         │P(2π)          │P(π)          │P(π)         │P(π/2) │  iqft │
out_1: ┤1     ├─────────■───────────────■──────────────■─────────────■───────┤1      ├
       └──────┘                                                              └───────┘
```

> **See also**
>
> The [`MultiplierGate`](/docs/api/qiskit/2.3/qiskit.circuit.library.MultiplierGate "qiskit.circuit.library.MultiplierGate") object represents a multiplication, like this circuit class, but allows the compiler to select the optimal decomposition based on the context. Specific implementations can be set via the [`HLSConfig`](/docs/api/qiskit/2.3/qiskit.transpiler.passes.HLSConfig "qiskit.transpiler.passes.HLSConfig"), e.g. this circuit can be chosen via `Multiplier=["qft_r17"]`.

References:

\[1] Ruiz-Perez et al., Quantum arithmetic with the Quantum Fourier Transform, 2017. [arXiv:1411.5949](https://arxiv.org/pdf/1411.5949.pdf)

**Parameters**

- **num\_state\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int)) – The number of qubits in either input register for state $|a\rangle$ or $|b\rangle$. The two input registers must have the same number of qubits.
- **num\_result\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – The number of result qubits to limit the output to. If number of result qubits is $n$, multiplication modulo $2^n$ is performed to limit the output to the specified number of qubits. Default value is `2 * num_state_qubits` to represent any possible result from the multiplication of the two inputs.
- **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – The name of the circuit object.

## Attributes

### name

Type: `str`

A human-readable name for the circuit.

**Example**

```python
from qiskit import QuantumCircuit

qc = QuantumCircuit(2, 2, name="my_circuit")
print(qc.name)
```

```text
my_circuit
```
