131 lines
3.6 KiB
Plaintext
131 lines
3.6 KiB
Plaintext
---
|
||
title: PermutationGate
|
||
description: API reference for qiskit.circuit.library.PermutationGate
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.circuit.library.PermutationGate
|
||
---
|
||
|
||
# PermutationGate
|
||
|
||
<Class id="qiskit.circuit.library.PermutationGate" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.23/qiskit/circuit/library/generalized_gates/permutation.py" signature="PermutationGate(pattern)" modifiers="class">
|
||
Bases: [`qiskit.circuit.gate.Gate`](qiskit.circuit.Gate "qiskit.circuit.gate.Gate")
|
||
|
||
A gate that permutes qubits.
|
||
|
||
Return a permutation gate.
|
||
|
||
**Parameters**
|
||
|
||
**pattern** (`List`\[`int`]) – permutation pattern, describing which qubits occupy the positions 0, 1, 2, etc. after applying the permutation, that is `pattern[k] = m` when the permutation maps qubit `m` to position `k`. As an example, the pattern `[2, 4, 3, 0, 1]` means that qubit `2` goes to position `0`, qubit `4` goes to the position `1`, etc.
|
||
|
||
**Raises**
|
||
|
||
**CircuitError** – if permutation pattern is malformed.
|
||
|
||
**Reference Circuit:**
|
||
|
||

|
||
|
||
**Expanded Circuit:**
|
||
|
||

|
||
|
||
## Methods Defined Here
|
||
|
||
### inverse
|
||
|
||
<Function id="qiskit.circuit.library.PermutationGate.inverse" signature="PermutationGate.inverse()">
|
||
Returns the inverse of the permutation.
|
||
</Function>
|
||
|
||
### qasm
|
||
|
||
<Function id="qiskit.circuit.library.PermutationGate.qasm" signature="PermutationGate.qasm()">
|
||
The qasm for a permutation.
|
||
</Function>
|
||
|
||
### validate\_parameter
|
||
|
||
<Function id="qiskit.circuit.library.PermutationGate.validate_parameter" signature="PermutationGate.validate_parameter(parameter)">
|
||
Parameter validation.
|
||
</Function>
|
||
|
||
## Attributes
|
||
|
||
### condition\_bits
|
||
|
||
<Attribute id="qiskit.circuit.library.PermutationGate.condition_bits">
|
||
Get Clbits in condition.
|
||
|
||
**Return type**
|
||
|
||
`List`\[[`Clbit`](qiskit.circuit.Clbit "qiskit.circuit.classicalregister.Clbit")]
|
||
</Attribute>
|
||
|
||
### decompositions
|
||
|
||
<Attribute id="qiskit.circuit.library.PermutationGate.decompositions">
|
||
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
|
||
</Attribute>
|
||
|
||
### definition
|
||
|
||
<Attribute id="qiskit.circuit.library.PermutationGate.definition">
|
||
Return definition in terms of other basic gates.
|
||
</Attribute>
|
||
|
||
### duration
|
||
|
||
<Attribute id="qiskit.circuit.library.PermutationGate.duration">
|
||
Get the duration.
|
||
</Attribute>
|
||
|
||
### label
|
||
|
||
<Attribute id="qiskit.circuit.library.PermutationGate.label">
|
||
Return instruction label
|
||
|
||
**Return type**
|
||
|
||
`str`
|
||
</Attribute>
|
||
|
||
### name
|
||
|
||
<Attribute id="qiskit.circuit.library.PermutationGate.name">
|
||
Return the name.
|
||
</Attribute>
|
||
|
||
### num\_clbits
|
||
|
||
<Attribute id="qiskit.circuit.library.PermutationGate.num_clbits">
|
||
Return the number of clbits.
|
||
</Attribute>
|
||
|
||
### num\_qubits
|
||
|
||
<Attribute id="qiskit.circuit.library.PermutationGate.num_qubits">
|
||
Return the number of qubits.
|
||
</Attribute>
|
||
|
||
### params
|
||
|
||
<Attribute id="qiskit.circuit.library.PermutationGate.params">
|
||
return instruction params.
|
||
</Attribute>
|
||
|
||
### pattern
|
||
|
||
<Attribute id="qiskit.circuit.library.PermutationGate.pattern">
|
||
Returns the permutation pattern defining this permutation.
|
||
</Attribute>
|
||
|
||
### unit
|
||
|
||
<Attribute id="qiskit.circuit.library.PermutationGate.unit">
|
||
Get the time unit of duration.
|
||
</Attribute>
|
||
</Class>
|
||
|