# compositeGate

**Installation Required:** This functionality requires MATLAB Support Package for Quantum Computing.

## Syntax

## Description

constructs a composite gate from an inner quantum circuit and returns a `cg`

= compositeGate(`circuit`

,`targetQubits`

)`quantum.gate.CompositeGate`

object. The specified target qubits map each qubit of
the inner circuit to a qubit of the outer circuit containing the composite gate.

The length of the `targetQubits`

vector must be equal to the number of
qubits in `circuit`

. The `Name`

property of
`circuit`

is copied to the `Name`

property of
`cg`

.

constructs a composite gate from an array of inner gates. The specified target qubits map
each each qubit that the gates act on to a qubit of the outer circuit containing the
composite gate.`cg`

= compositeGate(`gates`

,`targetQubits`

)

The length of the `targetQubits`

vector must be greater than or equal
to the largest qubit index in `gates`

.

## Examples

## Input Arguments

## Version History

**Introduced in R2023a**