---
title: SupportsApplyUnitaryPlaced (latest version)
description: API reference for qiskit_fermions.protocols.SupportsApplyUnitaryPlaced in the latest version of qiskit-fermions
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit-fermions/protocols-supports-apply-unitary-placed
---

# SupportsApplyUnitaryPlaced

*class* `SupportsApplyUnitaryPlaced(*args, **kwargs)`

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

A package-specific extension of [`SupportsApplyUnitary`](/docs/api/qiskit-fermions/protocols-supports-apply-unitary "qiskit_fermions.protocols.SupportsApplyUnitary") carrying a mode placement.

Unlike [`SupportsApplyUnitary`](/docs/api/qiskit-fermions/protocols-supports-apply-unitary "qiskit_fermions.protocols.SupportsApplyUnitary") (mirroring [`ffsim.SupportsApplyUnitary`](https://qiskit-community.github.io/ffsim/api/stubs/ffsim.SupportsApplyUnitary.html#ffsim.SupportsApplyUnitary "(in ffsim)")), this protocol has no ffsim equivalent and no helper function: [`_apply_unitary_placed_()`](/docs/api/qiskit-fermions/circuit-fermionic-circuit#_apply_unitary_placed_ "qiskit_fermions.circuit.FermionicCircuit._apply_unitary_placed_") is the only caller, and it dispatches to it directly via `getattr` duck-typing rather than through a free function. It exists here purely for typing and documentation purposes, since every concrete [`FermionicGate`](/docs/api/qiskit-fermions/circuit-fermionic-gate "qiskit_fermions.circuit.FermionicGate") (as well as [`FermionicCircuit`](/docs/api/qiskit-fermions/circuit-fermionic-circuit "qiskit_fermions.circuit.FermionicCircuit") itself) implements this method.

See [`FermionicCircuit._apply_unitary_placed_()`](/docs/api/qiskit-fermions/circuit-fermionic-circuit#_apply_unitary_placed_ "qiskit_fermions.circuit.FermionicCircuit._apply_unitary_placed_") for the full semantics, including how a plain [`SupportsApplyUnitary`](/docs/api/qiskit-fermions/protocols-supports-apply-unitary "qiskit_fermions.protocols.SupportsApplyUnitary") implementation (with no mode-placement argument) is honored only on the identity placement.

**Protocol Methods**

### \_apply\_unitary\_placed\_

`_apply_unitary_placed_(vec, norb, nelec, copy, freg_indices)`

Applies a unitary transformation to a state vector, after placing local modes onto global ones.

**Parameters**

- **vec** (*np.ndarray*) – the state vector to apply the unitary transformation to.
- **norb** ([*int*](https://docs.python.org/3/library/functions.html#int)) – the number of spatial orbitals of the *global* state vector.
- **nelec** ([*int*](https://docs.python.org/3/library/functions.html#int)  *|*[*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*,* [*int*](https://docs.python.org/3/library/functions.html#int)*]*) – either a single integer representing the number of fermions for a spinless system, or a pair of integers storing the numbers of spin alpha and spin beta fermions.
- **copy** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – whether to copy the vector before operating on it.
- **freg\_indices** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*]*) – the absolute (global) mode indices that this object’s local modes map onto.

**Returns**

The transformed vector.

**Return type**

np.ndarray
