40 lines
1.1 KiB
Plaintext
40 lines
1.1 KiB
Plaintext
---
|
||
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>
|
||
|