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

# MCXSynthesisGrayCode

*class* `qiskit.transpiler.passes.synthesis.hls_plugins.MCXSynthesisGrayCode`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/transpiler/passes/synthesis/hls_plugins.py#L1385-L1411)

Bases: [`HighLevelSynthesisPlugin`](/docs/api/qiskit/qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin "qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin")

Synthesis plugin for a multi-controlled X gate based on the Gray code.

This plugin name is :`mcx.gray_code` which can be used as the key on an [`HLSConfig`](/docs/api/qiskit/qiskit.transpiler.passes.HLSConfig "qiskit.transpiler.passes.HLSConfig") object to use this method with [`HighLevelSynthesis`](/docs/api/qiskit/qiskit.transpiler.passes.HighLevelSynthesis "qiskit.transpiler.passes.HighLevelSynthesis").

For a multi-controlled X gate with $k$ control qubits this synthesis method requires no additional clean auxiliary qubits. The synthesized circuit consists of $k + 1$ qubits.

It is not recommended to use this method for large values of $k + 1$ as it produces exponentially many gates.

## Methods

### run

`run(high_level_object, coupling_map=None, target=None, qubits=None, **options)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/transpiler/passes/synthesis/hls_plugins.py#L1399-L1411)

Run synthesis for the given MCX gate.
