QPanda3
0.1.0
Supported by OriginQ
|
Classes | |
class | Chi |
class | Choi |
class | DensityMatrix |
class | Kraus |
class | Matrix |
class | PTM |
class | QuantumChannel |
class | StateSystemType |
class | StateVector |
class | SuperOp |
class | Unitary |
Functions | |
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. | |
float pyqpanda3.quantum_info.hellinger_distance | ( | dict[int, float] | p, |
dict[int, float] | q ) |
hellinger_distance(*args, **kwargs) Overloaded function.
Template function to calculate the Hellinger distance between two probability distributions.
dist_p | A reference to the first probability distribution, represented as an unordered map with keys of type long long and values of type double. |
dist_q | A reference to the second probability distribution, represented as an unordered map with keys of type long long and values of type double. |
Template function to calculate the Hellinger distance between two probability distributions.
dist_p | A reference to the first probability distribution, represented as an unordered map with keys of type string and values of type double. |
dist_q | A reference to the second probability distribution, represented as an unordered map with keys of type string and values of type double. |
float pyqpanda3.quantum_info.hellinger_distance | ( | dict[str, float] | p, |
dict[str, float] | q ) |
hellinger_distance(*args, **kwargs) Overloaded function.
Template function to calculate the Hellinger distance between two probability distributions.
dist_p | A reference to the first probability distribution, represented as an unordered map with keys of type long long and values of type double. |
dist_q | A reference to the second probability distribution, represented as an unordered map with keys of type long long and values of type double. |
Template function to calculate the Hellinger distance between two probability distributions.
dist_p | A reference to the first probability distribution, represented as an unordered map with keys of type string and values of type double. |
dist_q | A reference to the second probability distribution, represented as an unordered map with keys of type string and values of type double. |
float pyqpanda3.quantum_info.hellinger_fidelity | ( | dict[int, float] | p, |
dict[int, float] | q ) |
hellinger_fidelity(*args, **kwargs) Overloaded function.
Calculates the Hellinger fidelity between two probability distributions represented as unordered maps.
dist_p | A constant reference to the first probability distribution. |
dist_q | A constant reference to the second probability distribution. |
Calculates the Hellinger fidelity between two probability distributions represented as unordered maps.
dist_p | A constant reference to the first probability distribution. |
dist_q | A constant reference to the second probability distribution. |
float pyqpanda3.quantum_info.hellinger_fidelity | ( | dict[str, float] | p, |
dict[str, float] | q ) |
hellinger_fidelity(*args, **kwargs) Overloaded function.
Calculates the Hellinger fidelity between two probability distributions represented as unordered maps.
dist_p | A constant reference to the first probability distribution. |
dist_q | A constant reference to the second probability distribution. |
Calculates the Hellinger fidelity between two probability distributions represented as unordered maps.
dist_p | A constant reference to the first probability distribution. |
dist_q | A constant reference to the second probability distribution. |
float pyqpanda3.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.
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})} \]
p | A constant reference to the first probability distribution. |
q | A constant reference to the second probability distribution. |
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_pdf | A pointer to a function representing the probability distribution p(x). |
q_pdf | A pointer to a function representing the probability distribution q(x). |
x_start | The starting point of the integration. |
x_end | The end point of the integration. |
dx | The step size for the numerical integration (default is 1e-4). |
float pyqpanda3.quantum_info.KL_divergence | ( | list[float] | p, |
list[float] | q ) |
KL_divergence(*args, **kwargs) Overloaded function.
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})} \]
p | A constant reference to the first probability distribution. |
q | A constant reference to the second probability distribution. |
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_pdf | A pointer to a function representing the probability distribution p(x). |
q_pdf | A pointer to a function representing the probability distribution q(x). |
x_start | The starting point of the integration. |
x_end | The end point of the integration. |
dx | The step size for the numerical integration (default is 1e-4). |