---
title: generate_preset_clifford_t_pass_manager (latest version)
description: API reference for qiskit.transpiler.generate_preset_clifford_t_pass_manager in the latest version of qiskit
source: https://quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.transpiler.generate_preset_clifford_t_pass_manager
---

# qiskit.transpiler.generate\_preset\_clifford\_t\_pass\_manager

`qiskit.transpiler.generate_preset_clifford_t_pass_manager(optimization_level=2, target=None, basis_gates=None, coupling_map=None, initial_layout=None, approximation_degree=1.0, seed_transpiler=None, unitary_synthesis_method='default', unitary_synthesis_plugin_config=None, hls_config=None, dt=None, qubits_initially_zero=True, rz_synthesis_config=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/transpiler/preset_passmanagers/generate_preset_pass_manager.py#L293-L459)

Generate a preset Clifford+T [`StagedPassManager`](/docs/api/qiskit/qiskit.transpiler.StagedPassManager "qiskit.transpiler.StagedPassManager").

This function provides a convenient way to construct a preset pass manager for Clifford+T compilation. We recommend using this function instead of [`transpile()`](/docs/api/qiskit/compiler#qiskit.compiler.transpile "qiskit.compiler.transpile") or [`generate_preset_pass_manager()`](/docs/api/qiskit/qiskit.transpiler.generate_preset_pass_manager "qiskit.transpiler.generate_preset_pass_manager") with a Clifford+T basis, as it exposes arguments specifically tailored for Clifford+T compilations.

The target constraints for the pass manager construction can be specified through a [`Target`](/docs/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") instance, or via loose constraints (`basis_gates`, `coupling_map`, or `dt`).

If basis gates are not specified (neither via `target` nor via `basis_gates`), then basis gates default to all of the Clifford+T gates in Qiskit. Note, however, that if basis gates are specified but do not represent a Clifford+T basis, then an error will be raised.

**Examples**

Generate and use a simple Clifford+T pass manager:

```python
from qiskit.circuit import QuantumCircuit
from qiskit.transpiler import generate_preset_clifford_t_pass_manager

qc = QuantumCircuit(1)
qc.rz(2.3579, 0)

pm = generate_preset_clifford_t_pass_manager()
qct = pm.run(qc)
```

Various options are configurable; see the arguments documentation for more detail:

```python
rz_synthesis_config = {
    "rz_synthesis_error": 1e-4,
    "rz_cache_error": 1e-5,
}

basis_gates = ["cx", "s", "sdg", "h", "t", "tdg"]
pm = generate_preset_clifford_t_pass_manager(
    rz_synthesis_config=rz_synthesis_config,
    basis_gates=basis_gates,
    optimization_level=3,
)
```

**Parameters**

- **optimization\_level** ([*int*](https://docs.python.org/3/library/functions.html#int)) – The optimization level to generate a [`StagedPassManager`](/docs/api/qiskit/qiskit.transpiler.StagedPassManager "qiskit.transpiler.StagedPassManager") for. By default optimization level 2 is used if this is not specified. This can be 0, 1, 2, or 3. Higher levels generate potentially more optimized circuits, at the expense of potentially longer transpilation time.

- **target** ([*Target*](/docs/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") *| None*) – The [`Target`](/docs/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") representing a compilation target. The following attributes will be inferred from this argument if they are not set: `coupling_map` and `basis_gates`.

- **basis\_gates** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*] | None*) – List of basis gate names to unroll to (e.g: `['cx', 's', 'sx', 't', 'tdg']`). If both `target` and `basis_gates` are `None`, `basis_gates` will be set to all of the standard Clifford gates together with `'t'` and `'tdg'`.

- **coupling\_map** ([*CouplingMap*](/docs/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap")  *|*[*list*](https://docs.python.org/3/library/stdtypes.html#list) *| None*) –

  Directed graph represented a coupling map. Multiple formats are supported:

  1. `CouplingMap` instance
  2. List, must be given as an adjacency matrix, where each entry specifies all directed two-qubit interactions supported by backend, e.g: `[[0, 1], [0, 3], [1, 2], [1, 5], [2, 5], [4, 1], [5, 3]]`

- **dt** ([*float*](https://docs.python.org/3/library/functions.html#float) *| None*) – Target sample time (resolution) in seconds. If `None` (default) and a target is provided, `target.dt` is used.

- **initial\_layout** ([*Layout*](/docs/api/qiskit/qiskit.transpiler.Layout "qiskit.transpiler.Layout")  *|*[*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*]*) – Initial position of virtual qubits on physical qubits.

- **approximation\_degree** ([*float*](https://docs.python.org/3/library/functions.html#float) *| None*) – Heuristic dial used for circuit approximation, where `1.0` means no approximation (up to numerical tolerance) and `0.0` means the maximum approximation. If `target` is available, a value of `None` indicates that approximation is allowed up to the reported error rate for an operation in the target.

- **seed\_transpiler** ([*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – Sets random seed for the stochastic parts of the transpiler. If it is not specified here it can also be specified via an environment variable: `QISKIT_TRANSPILER_SEED` or in a user configuration file. The priority order is: this argument, then the environment variable, and finally the user configuration option. So setting this argument will take precedence over the other methods of setting a seed.

- **unitary\_synthesis\_method** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – The name of the unitary synthesis method to use. By default `'default'` is used. You can see a list of installed plugins with [`unitary_synthesis_plugin_names()`](/docs/api/qiskit/qiskit.transpiler.passes.synthesis.plugin.unitary_synthesis_plugin_names "qiskit.transpiler.passes.synthesis.plugin.unitary_synthesis_plugin_names").

- **unitary\_synthesis\_plugin\_config** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict) *| None*) – An optional configuration dictionary that will be passed directly to the unitary synthesis plugin. By default this setting will have no effect as the default unitary synthesis method does not take custom configuration. This should only be necessary when a unitary synthesis plugin is specified with the `unitary_synthesis_method` argument. As this is custom for each unitary synthesis plugin refer to the plugin documentation for how to use this option.

- **hls\_config** ([*HLSConfig*](/docs/api/qiskit/qiskit.transpiler.passes.HLSConfig "qiskit.transpiler.passes.HLSConfig") *| None*) – An optional configuration class [`HLSConfig`](/docs/api/qiskit/qiskit.transpiler.passes.HLSConfig "qiskit.transpiler.passes.HLSConfig") that will be passed directly to [`HighLevelSynthesis`](/docs/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transformation pass. This configuration class allows to specify for various high-level objects the lists of synthesis algorithms and their parameters.

- **qubits\_initially\_zero** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – Indicates whether the input circuit is zero-initialized.

- **rz\_synthesis\_config** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict) *| None*) – An optional configuration class to use for [`SynthesizeRZRotations`](/docs/api/qiskit/qiskit.transpiler.passes.SynthesizeRZRotations "qiskit.transpiler.passes.SynthesizeRZRotations") pass. Specifies how to synthesize RZ rotations in the circuit.

**Returns**

The preset pass manager for the given options.

**Return type**

[StagedPassManager](/docs/api/qiskit/qiskit.transpiler.StagedPassManager "qiskit.transpiler.StagedPassManager")

**Raises**

- [**TranspilerError**](/docs/api/qiskit/transpiler#qiskit.transpiler.TranspilerError "qiskit.transpiler.TranspilerError") – if a basis other than Clifford+T is specified.
- [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError) – if an invalid value for `optimization_level` is passed in.
