qiskit-documentation/docs/api/qiskit/0.31/qiskit.quantum_info.partial...

36 lines
1.3 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: partial_trace (v0.31)
description: API reference for qiskit.quantum_info.partial_trace in qiskit v0.31
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.quantum_info.partial_trace
---
<span id="qiskit-quantum-info-partial-trace" />
# qiskit.quantum\_info.partial\_trace
<Function id="qiskit.quantum_info.partial_trace" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.18/qiskit/quantum_info/states/utils.py" signature="partial_trace(state, qargs)">
Return reduced density matrix by tracing out part of quantum state.
If all subsystems are traced over this returns the [`trace()`](qiskit.quantum_info.DensityMatrix#trace "qiskit.quantum_info.DensityMatrix.trace") of the input state.
**Parameters**
* **state** ([*Statevector*](qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector") *or*[*DensityMatrix*](qiskit.quantum_info.DensityMatrix "qiskit.quantum_info.DensityMatrix")) the input state.
* **qargs** (*list*) The subsystems to trace over.
**Returns**
The reduced density matrix.
**Return type**
[DensityMatrix](qiskit.quantum_info.DensityMatrix "qiskit.quantum_info.DensityMatrix")
**Raises**
**QiskitError** if input state is invalid.
</Function>