---
title: LinearPauliRotations (latest version)
description: API reference for qiskit.circuit.library.LinearPauliRotations in the latest version of qiskit
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.circuit.library.LinearPauliRotations
---

# LinearPauliRotations

*class* `qiskit.circuit.library.LinearPauliRotations(num_state_qubits=None, slope=1, offset=0, basis='Y', name='LinRot')`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/circuit/library/arithmetic/linear_pauli_rotations.py#L25-L168)

Bases: [`FunctionalPauliRotations`](/docs/api/qiskit/qiskit.circuit.library.FunctionalPauliRotations "qiskit.circuit.library.arithmetic.functional_pauli_rotations.FunctionalPauliRotations")

Linearly-controlled X, Y or Z rotation.

For a register of state qubits $|x\rangle$, a target qubit $|0\rangle$ and the basis `'Y'` this circuit acts as:

```text
    q_0: ─────────────────────────■───────── ... ──────────────────────
                                  │
                                  .
                                  │
q_(n-1): ─────────────────────────┼───────── ... ───────────■──────────
          ┌────────────┐  ┌───────┴───────┐       ┌─────────┴─────────┐
    q_n: ─┤ RY(offset) ├──┤ RY(2^0 slope) ├  ...  ┤ RY(2^(n-1) slope) ├
          └────────────┘  └───────────────┘       └───────────────────┘
```

This can for example be used to approximate linear functions, with $a =$ `slope`$/2$ and $b =$ `offset`$/2$ and the basis `'Y'`:

$$
|x\rangle |0\rangle \mapsto \cos(ax + b)|x\rangle|0\rangle + \sin(ax + b)|x\rangle |1\rangle
$$

Since for small arguments $\sin(x) \approx x$ this operator can be used to approximate linear functions.

**Parameters**

- **num\_state\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – The number of qubits representing the state $|x\rangle$.
- **slope** ([*float*](https://docs.python.org/3/library/functions.html#float)) – The slope of the controlled rotation.
- **offset** ([*float*](https://docs.python.org/3/library/functions.html#float)) – The offset of the controlled rotation.
- **basis** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – The type of Pauli rotation (‘X’, ‘Y’, ‘Z’).
- **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – The name of the circuit object.

## Attributes

### offset

The angle of the single qubit offset rotation on the target qubit.

Before applying the controlled rotations, a single rotation of angle `offset` is applied to the target qubit.

**Returns**

The offset angle.

### slope

The multiplicative factor in the rotation angle of the controlled rotations.

The rotation angles are `slope * 2^0`, `slope * 2^1`, … , `slope * 2^(n-1)` where `n` is the number of state qubits.

**Returns**

The rotation angle common in all controlled rotations.

### 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
```
