技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
skill-028【数据与研究】A skill for reconstructing quantum states from measurement data using quantum state tomography techniques. Use when you need to derive the density matrix of a quantum system from experimental measurements, allowing for the verification of quantum states in various quantum experiments.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Quantum state tomography is a process used to reconstruct the quantum state of a system based on measurement outcomes. This skill provides tools for efficiently performing quantum state tomography using available measurement data.
uv pip install qst
import numpy as np
from qst import StateTomography
# Simulated measurement outcomes
measurement_data = np.array([[0, 1], [1, 0], [1, 1]]) # Example outcomes
# Create a StateTomography object
qst = StateTomography(measurement_data)
# Perform state reconstruction
rho_estimated = qst.reconstruct()
print(rho_estimated)
Handle measurement data efficiently:
# Load measurement results from a file
measurement_data = np.loadtxt('measurements.txt')
# Filter data based on specific criteria
filtered_data = qst.filter_data(measurement_data, threshold=0.5)
Reconstruct quantum states using various algorithms:
# Maximum likelihood estimation
rho_ml = qst.max_likelihood()
# Linear inversion
rho_inv = qst.linear_inversion()
Visualize the reconstructed density matrix:
import matplotlib.pyplot as plt
qst.visualize_density_matrix(rho_estimated)
plt.title('Reconstructed Density Matrix')
plt.show()
Evaluate performance:
fidelity = qst.calculate_fidelity(rho_estimated, true_state)
print(f'Fidelity: {fidelity}')
Quantum state tomography is essential for verifying and analyzing quantum systems. The tools provided in this skill facilitate the reconstruction of quantum states from experimental data, crucial for advancing quantum information science.