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

# HLSConfig

*class* `qiskit.transpiler.passes.HLSConfig(use_default_on_unspecified=True, plugin_selection='sequential', plugin_evaluation_fn=None, **kwargs)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/transpiler/passes/synthesis/high_level_synthesis.py#L42-L126)

Bases: [`object`](https://docs.python.org/3/library/functions.html#object)

The high-level-synthesis config allows to specify a list of “methods” used by [`HighLevelSynthesis`](/docs/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis") transformation pass to synthesize different types of higher-level objects.

A higher-level object is an object of type [`Operation`](/docs/api/qiskit/qiskit.circuit.Operation "qiskit.circuit.Operation") (e.g., [`Clifford`](/docs/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") or [`LinearFunction`](/docs/api/qiskit/qiskit.circuit.library.LinearFunction "qiskit.circuit.library.LinearFunction")). Each object is referred to by its [`name`](/docs/api/qiskit/qiskit.circuit.Operation#name "qiskit.circuit.Operation.name") field (e.g., `"clifford"` for [`Clifford`](/docs/api/qiskit/qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford") objects), and the applicable synthesis methods are tied to this name.

In the config, each method is specified in one of several ways:

1. a tuple consisting of the name of a known synthesis plugin and a dictionary providing additional arguments for the algorithm.
2. a tuple consisting of an instance of [`HighLevelSynthesisPlugin`](/docs/api/qiskit/qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin") and additional arguments for the algorithm.
3. a single string of a known synthesis plugin
4. a single instance of [`HighLevelSynthesisPlugin`](/docs/api/qiskit/qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin").

The following example illustrates different ways how a config file can be created:

```python
from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig
from qiskit.transpiler.passes.synthesis.high_level_synthesis import ACGSynthesisPermutation

# All the ways to specify hls_config are equivalent
hls_config = HLSConfig(permutation=[("acg", {})])
hls_config = HLSConfig(permutation=["acg"])
hls_config = HLSConfig(permutation=[(ACGSynthesisPermutation(), {})])
hls_config = HLSConfig(permutation=[ACGSynthesisPermutation()])
```

The names of the synthesis plugins should be declared in `entry-points` table for `qiskit.synthesis` in `pyproject.toml`, in the form \<higher-level-object-name>.\<synthesis-method-name>.

The standard higher-level-objects are recommended to have a synthesis method called “default”, which would be called automatically when synthesizing these objects, without having to explicitly set these methods in the config.

To avoid synthesizing a given higher-level-object, one can give it an empty list of methods.

For an explicit example of using such config files, refer to the documentation for [`HighLevelSynthesis`](/docs/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis").

For an overview of the complete process of using high-level synthesis, see [High-level Synthesis Plugins](/docs/api/qiskit/transpiler_synthesis_plugins#using-high-level-synthesis-plugins).

Creates a high-level-synthesis config.

**Parameters**

- **use\_default\_on\_unspecified** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – if True, every higher-level-object without an explicitly specified list of methods will be synthesized using the “default” algorithm if it exists.
- **plugin\_selection** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – if set to `"sequential"` (default), for every higher-level-object the synthesis pass will consider the specified methods sequentially, stopping at the first method that is able to synthesize the object. If set to `"all"`, all the specified methods will be considered, and the best synthesized circuit, according to `plugin_evaluation_fn` will be chosen.
- **plugin\_evaluation\_fn** (*Callable\[\[*[*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")*],* [*int*](https://docs.python.org/3/library/functions.html#int)*] | None*) – a callable that evaluates the quality of the synthesized quantum circuit in the case that `plugin_selection="sequential"`; a smaller value means a better circuit. If `None`, the quality of the circuit is its size (i.e. the number of gates that it contains).
- **kwargs** – a dictionary mapping higher-level-objects to lists of synthesis methods.

## Methods

### set\_methods

`set_methods(hls_name, hls_methods)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/transpiler/passes/synthesis/high_level_synthesis.py#L123-L126)

Sets the list of synthesis methods for a given higher-level-object. This overwrites the lists of methods if also set previously.
