Skip to content

ディープテック経済

市場が追いついたら、もう遅い。

Menu
Menu

量子计算机误差缓解技术“mitiq”的介绍

Posted on 2023年1月23日 by DeepRecommend
https://github.com/unitaryfund/mitiq

什么是米奇科?

用于在量子计算机中实现错误缓解技术的
软件包。

目前的量子计算机

  • 与环境的交互
  • 不完整的门应用
  • 由于状态准备和测量错误
    ,噪声增加。

错误缓解是通过巧妙地编译量子程序来
减少软件级别的这些影响。

开始

安装。

!pip install mitiq

输入电路并定义返回要计算的期望值的函数,
并使用 mitiq 减少错误。

import cirq
from mitiq import zne, benchmarks

def execute(circuit: cirq. Circuit, noise_level: float = 0.001) -> float:
    """Returs Tr[ρ |0⟩⟨0|] where ρ is the state prepared by the circuit with depolarizing noise."""
    noisy_circuit = circuit.with_noise(cirq.depolarize(p=noise_level))
    return cirq. DensityMatrixSimulator().simulate(noisy_circuit).final_density_matrix[0, 0].real

circuit: cirq. Circuit = benchmarks.generate_rb_circuits(n_qubits=1, num_cliffords=50)[0]

true_value = execute(circuit, noise_level=0.0) = 理想
noisy_value = execute(circuit) # 噪音有
zne_value = zne.execute_with_zne(circuit, execute) # 噪音有 + mitiq

print(f"Error (w/o  Mitiq): %0.4f" %abs((true_value - noisy_value) / true_value))
print(f"Error (with Mitiq): %0.4f" %abs((true_value - zne_value) / true_value))

Error (w/o Mitiq): 0.0688
Error (with Mitiq): 0.0002

发表回复 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注

分类

  • アーカイブ (22)

归档

  • 2023 年 4 月 (7)
  • 2023 年 3 月 (5)
  • 2023 年 2 月 (9)
  • 2023 年 1 月 (57)
  • 2022 年 12 月 (8)
  • 2022 年 11 月 (1)
© 2025 ディープテック経済 | Powered by Minimalist Blog WordPress Theme