Shortcuts

qiskit.quantum_info.shannon_entropy

shannon_entropy(pvec, base=2)[소스]

Compute the Shannon entropy of a probability vector.

The shannon entropy of a probability vector \(\vec{p} = [p_0, ..., p_{n-1}]\) is defined as

\[H(\vec{p}) = \sum_{i=0}^{n-1} p_i \log_b(p_i)\]

where \(b\) is the log base and (default 2), and \(0 \log_b(0) \equiv 0\).

매개변수
  • pvec (array_like) – a probability vector.

  • base (int) – the base of the logarithm [Default: 2].

반환값

The Shannon entropy H(pvec).

반환 형식

float

당신은 다음 언어로 문서를 보고 있다 lang: Korean
언어
English
Japanese
German
Korean