qiskit-documentation/docs/api/qiskit/0.26/qiskit.quantum_info.entropy...

40 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: entropy (v0.26)
description: API reference for qiskit.quantum_info.entropy in qiskit v0.26
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.quantum_info.entropy
---
<span id="qiskit-quantum-info-entropy" />
# qiskit.quantum\_info.entropy
<Function id="qiskit.quantum_info.entropy" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.17/qiskit/quantum_info/states/measures.py" signature="entropy(state, base=2)">
Calculate the von-Neumann entropy of a quantum state.
The entropy $S$ is given by
$$
S(\rho) = - Tr[\rho \log(\rho)]
$$
**Parameters**
* **state** ([*Statevector*](qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector") *or*[*DensityMatrix*](qiskit.quantum_info.DensityMatrix "qiskit.quantum_info.DensityMatrix")) a quantum state.
* **base** (*int*) the base of the logarithm \[Default: 2].
**Returns**
The von-Neumann entropy S(rho).
**Return type**
float
**Raises**
**QiskitError** if the input state is not a valid QuantumState.
</Function>