Skip to content

量子网络 — 练习

Download exercise.py

运行方式

bash
cd docs/quantum/network/code
python exercise.py

任务

实现纯态保真度 F=|a|b|2

python
def fidelity(a, b):
    return float(np.abs(np.vdot(a, b)) ** 2)

源码位置

clone 后打开(相对仓库根目录):

docs/quantum/network/code/exercise.py