QPanda3
Supported by OriginQ
载入中...
搜索中...
未找到
pyqpanda3.quantum_info.quantum_info 命名空间参考

class  Chi
 
class  Choi
 
class  DensityMatrix
 
class  Kraus
 
class  Matrix
 
class  PTM
 
class  QuantumChannel
 
class  StateSystemType
 
class  StateVector
 
class  SuperOp
 
class  Unitary
 

函数

float KL_divergence (list[float] p, list[float] q)
 KL_divergence(*args, **kwargs) Overloaded function.
 
float KL_divergence (Callable[[float], float] p_pdf, Callable[[float], float] q_pdf, float x_start, float x_end, float dx=...)
 KL_divergence(*args, **kwargs) Overloaded function.
 
float hellinger_distance (dict[int, float] p, dict[int, float] q)
 hellinger_distance(*args, **kwargs) Overloaded function.
 
float hellinger_distance (dict[str, float] p, dict[str, float] q)
 hellinger_distance(*args, **kwargs) Overloaded function.
 
float hellinger_fidelity (dict[int, float] p, dict[int, float] q)
 hellinger_fidelity(*args, **kwargs) Overloaded function.
 
float hellinger_fidelity (dict[str, float] p, dict[str, float] q)
 hellinger_fidelity(*args, **kwargs) Overloaded function.
 

函数说明

◆ hellinger_distance() [1/2]

float pyqpanda3.quantum_info.quantum_info.hellinger_distance ( dict[int, float] p,
dict[int, float] q )

hellinger_distance(*args, **kwargs) Overloaded function.

  1. hellinger_distance(p: dict[int, float], q: dict[int, float]) -> float

Template function to calculate the Hellinger distance between two probability distributions.

参数
dist_pA reference to the first probability distribution, represented as an unordered map with keys of type long long and values of type double.
dist_qA reference to the second probability distribution, represented as an unordered map with keys of type long long and values of type double.
返回
double The Hellinger distance between the two distributions.
  1. hellinger_distance(p: dict[str, float], q: dict[str, float]) -> float

Template function to calculate the Hellinger distance between two probability distributions.

参数
dist_pA reference to the first probability distribution, represented as an unordered map with keys of type string and values of type double.
dist_qA reference to the second probability distribution, represented as an unordered map with keys of type string and values of type double.
返回
double The Hellinger distance between the two distributions.

◆ hellinger_distance() [2/2]

float pyqpanda3.quantum_info.quantum_info.hellinger_distance ( dict[str, float] p,
dict[str, float] q )

hellinger_distance(*args, **kwargs) Overloaded function.

  1. hellinger_distance(p: dict[int, float], q: dict[int, float]) -> float

Template function to calculate the Hellinger distance between two probability distributions.

参数
dist_pA reference to the first probability distribution, represented as an unordered map with keys of type long long and values of type double.
dist_qA reference to the second probability distribution, represented as an unordered map with keys of type long long and values of type double.
返回
double The Hellinger distance between the two distributions.
  1. hellinger_distance(p: dict[str, float], q: dict[str, float]) -> float

Template function to calculate the Hellinger distance between two probability distributions.

参数
dist_pA reference to the first probability distribution, represented as an unordered map with keys of type string and values of type double.
dist_qA reference to the second probability distribution, represented as an unordered map with keys of type string and values of type double.
返回
double The Hellinger distance between the two distributions.

◆ hellinger_fidelity() [1/2]

float pyqpanda3.quantum_info.quantum_info.hellinger_fidelity ( dict[int, float] p,
dict[int, float] q )

hellinger_fidelity(*args, **kwargs) Overloaded function.

  1. hellinger_fidelity(p: dict[int, float], q: dict[int, float]) -> float

Calculates the Hellinger fidelity between two probability distributions represented as unordered maps.

参数
dist_pA constant reference to the first probability distribution.
dist_qA constant reference to the second probability distribution.
返回
double The Hellinger fidelity between the two distributions.
  1. hellinger_fidelity(p: dict[str, float], q: dict[str, float]) -> float

Calculates the Hellinger fidelity between two probability distributions represented as unordered maps.

参数
dist_pA constant reference to the first probability distribution.
dist_qA constant reference to the second probability distribution.
返回
double The Hellinger fidelity between the two distributions.

◆ hellinger_fidelity() [2/2]

float pyqpanda3.quantum_info.quantum_info.hellinger_fidelity ( dict[str, float] p,
dict[str, float] q )

hellinger_fidelity(*args, **kwargs) Overloaded function.

  1. hellinger_fidelity(p: dict[int, float], q: dict[int, float]) -> float

Calculates the Hellinger fidelity between two probability distributions represented as unordered maps.

参数
dist_pA constant reference to the first probability distribution.
dist_qA constant reference to the second probability distribution.
返回
double The Hellinger fidelity between the two distributions.
  1. hellinger_fidelity(p: dict[str, float], q: dict[str, float]) -> float

Calculates the Hellinger fidelity between two probability distributions represented as unordered maps.

参数
dist_pA constant reference to the first probability distribution.
dist_qA constant reference to the second probability distribution.
返回
double The Hellinger fidelity between the two distributions.

◆ KL_divergence() [1/2]

float pyqpanda3.quantum_info.quantum_info.KL_divergence ( Callable[[float], float] p_pdf,
Callable[[float], float] q_pdf,
float x_start,
float x_end,
float dx = ... )

KL_divergence(*args, **kwargs) Overloaded function.

  1. KL_divergence(p: list[float], q: list[float]) -> float

Calculates the Kullback-Leibler (KL) divergence between two discrete probability distributions.

The KL divergence is defined as: \[ \mathrm{KL}(\mathrm{p} \| \mathrm{q})=\sum \mathrm{p}(\mathrm{x}) \log \frac{\mathrm{p}(\mathrm{x})}{\mathrm{q}(\mathrm{x})} \]

注解
The KL divergence is not commutative, i.e., \(\mathrm{KL}(\mathrm{p} \| \mathrm{q}) \neq \mathrm{KL}(\mathrm{q} \| \mathrm{p})\).
参数
pA constant reference to the first probability distribution.
qA constant reference to the second probability distribution.
返回
double The KL divergence between the two distributions.
  1. KL_divergence(p_pdf: Callable[[float], float], q_pdf: Callable[[float], float], x_start: float, x_end: float, dx: float = 0.0001) -> float

Calculates the KL divergence for continuous probability distributions using function pointers.

The KL divergence is given by the formula: \f[ \mathrm{KL}(\mathrm{p} \| \mathrm{q})=\int \mathrm{p}(\mathrm{x}) \log \frac{\mathrm{p}(\mathrm{x})}{\mathrm{q}(\mathrm{x})} \mathrm{dx} \f]

参数
p_pdfA pointer to a function representing the probability distribution p(x).
q_pdfA pointer to a function representing the probability distribution q(x).
x_startThe starting point of the integration.
x_endThe end point of the integration.
dxThe step size for the numerical integration (default is 1e-4).
返回
double The calculated KL divergence.
注解
The KL divergence is not commutative.

◆ KL_divergence() [2/2]

float pyqpanda3.quantum_info.quantum_info.KL_divergence ( list[float] p,
list[float] q )

KL_divergence(*args, **kwargs) Overloaded function.

  1. KL_divergence(p: list[float], q: list[float]) -> float

Calculates the Kullback-Leibler (KL) divergence between two discrete probability distributions.

The KL divergence is defined as: \[ \mathrm{KL}(\mathrm{p} \| \mathrm{q})=\sum \mathrm{p}(\mathrm{x}) \log \frac{\mathrm{p}(\mathrm{x})}{\mathrm{q}(\mathrm{x})} \]

注解
The KL divergence is not commutative, i.e., \(\mathrm{KL}(\mathrm{p} \| \mathrm{q}) \neq \mathrm{KL}(\mathrm{q} \| \mathrm{p})\).
参数
pA constant reference to the first probability distribution.
qA constant reference to the second probability distribution.
返回
double The KL divergence between the two distributions.
  1. KL_divergence(p_pdf: Callable[[float], float], q_pdf: Callable[[float], float], x_start: float, x_end: float, dx: float = 0.0001) -> float

Calculates the KL divergence for continuous probability distributions using function pointers.

The KL divergence is given by the formula: \f[ \mathrm{KL}(\mathrm{p} \| \mathrm{q})=\int \mathrm{p}(\mathrm{x}) \log \frac{\mathrm{p}(\mathrm{x})}{\mathrm{q}(\mathrm{x})} \mathrm{dx} \f]

参数
p_pdfA pointer to a function representing the probability distribution p(x).
q_pdfA pointer to a function representing the probability distribution q(x).
x_startThe starting point of the integration.
x_endThe end point of the integration.
dxThe step size for the numerical integration (default is 1e-4).
返回
double The calculated KL divergence.
注解
The KL divergence is not commutative.