qiskit-documentation/docs/api/qiskit/0.26/qiskit.providers.aer.librar...

34 lines
1.1 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: set_unitary (v0.26)
description: API reference for qiskit.providers.aer.library.set_unitary in qiskit v0.26
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.providers.aer.library.set_unitary
---
<span id="qiskit-providers-aer-library-set-unitary" />
# qiskit.providers.aer.library.set\_unitary
<Function id="qiskit.providers.aer.library.set_unitary" isDedicatedPage={true} github="https://github.com/qiskit/qiskit-aer/tree/stable/0.8/qiskit/providers/aer/library/set_instructions/set_unitary.py" signature="set_unitary(self, state)">
Set the state state of the simulator.
**Parameters**
**state** ([*Operator*](qiskit.quantum_info.Operator "qiskit.quantum_info.Operator")) A state matrix.
**Returns**
with attached instruction.
**Return type**
[QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")
**Raises**
* **ExtensionError** If the state is the incorrect size for the current circuit.
* **ExtensionError** if the input matrix is not unitary.
</Function>