使用Qiskit的NumPy Eigensolver计算H₂自旋态时标识反转问题
H₂分子自旋态标识与预期不符的问题
我使用Qiskit的NumPy Eigensolver计算H₂分子的精确本征值与本征态时,发现叠加态的自旋标识和预期相反:正号叠加的态被判定为单态(Singlet,S²=0),负号叠加的态被判定为三重态(Triplet,S²=2),这和氢自旋异构体的常规描述不一致。
以下是我的实现代码:
分子定义与求解代码
# 定义H₂分子 driver = PySCFDriver(atom="H .0 .0 .0; H .0 .0 0.735", basis="sto3g") problem = driver.run() # 将哈密顿量映射到量子比特 mapper = JordanWignerMapper() qubit_op = mapper.map(problem.hamiltonian.second_q_op()) expected_num_electrons = 2 def filter_criterion_custom(eigenstate, eigenvalue, aux_values): num_particles_aux = aux_values["ParticleNumber"][0] total_angular_momentum_aux = np.round(aux_values["AngularMomentum"][0],10) return ( np.isclose(num_particles_aux, expected_num_electrons) ) # 经典能量计算 algo = NumPyEigensolver(k=10) algo.filter_criterion = filter_criterion_custom solver = ExcitedStatesEigensolver(mapper, algo) result = solver.solve(problem_reduced) S2_matrix = problem_reduced.properties.angular_momentum.second_q_ops()['AngularMomentum'] s2_matrix_qubit = mapper.map(S2_matrix)
检查S²的代码
for vec in result.eigenstates: psi = Statevector(vec[0]).data # numpy数组 print('S2:', np.round(np.vdot(psi, s2_matrix_qubit.to_matrix() @ psi),0)) print(get_nonzero_elements(psi)) print('---')
输出结果
S2: 0j (array([ 5, 10]), array([-0.99364675+0.j, 0.11254389+0.j])) --- S2: (2+0j) (array([3]), array([1.+0.j])) --- S2: (2+0j) (array([12]), array([1.+0.j])) --- S2: (2+0j) (array([9, 6]), array([ 0.70710678+0.j, -0.70710678+0.j])) --- S2: 0j (array([6, 9]), array([0.70710678+0.j, 0.70710678+0.j])) --- S2: 0j (array([10, 5]), array([0.99364675+0.j, 0.11254389+0.j])) ---
内容的提问来源于stack exchange,提问作者Maria Gabriela Oliveira
相关产品推荐
相关产品推荐

