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

31 lines
1014 B
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_density_matrix
description: API reference for qiskit.providers.aer.library.set_density_matrix
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.providers.aer.library.set_density_matrix
---
# qiskit.providers.aer.library.set\_density\_matrix
<Function id="qiskit.providers.aer.library.set_density_matrix" isDedicatedPage={true} github="https://github.com/qiskit/qiskit-aer/tree/stable/0.9/qiskit/providers/aer/library/set_instructions/set_density_matrix.py" signature="set_density_matrix(self, state)">
Set the density matrix state of the simulator.
**Parameters**
**state** ([*DensityMatrix*](qiskit.quantum_info.DensityMatrix "qiskit.quantum_info.DensityMatrix")) a density matrix.
**Returns**
with attached instruction.
**Return type**
[QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")
**Raises**
**ExtensionError** If the density matrix is the incorrect size for the current circuit.
</Function>