Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
`QPanda Algorithm API`\n
Simulating z-only term like H=coef * (Z0..Zn-1)\n
U=exp(-iHt)\n
\n
list, float, float -> QCircuit
Note: Z-Hamiltonian spreads over the qubit_list
'''
prog=QCircuit()
# parity-check
# RZ(theta)
# parity-check
if len(qubit_list) > 1:
prog.insert(parity_check_circuit(qubit_list))\
.insert(RZ(qubit_list[-1],coef*t))\
.insert(parity_check_circuit(qubit_list))
else:
if len(qubit_list)!=0:
prog.insert(RZ(qubit_list[0],coef*t))
return prog
U=exp(-iHt)\n
\n
list, float, float -> QCircuit
Note: Z-Hamiltonian spreads over the qubit_list
'''
prog=QCircuit()
# parity-check
# RZ(theta)
# parity-check
if len(qubit_list) > 1:
prog.insert(parity_check_circuit(qubit_list))\
.insert(RZ(qubit_list[-1],coef*t))\
.insert(parity_check_circuit(qubit_list))
else:
if len(qubit_list)!=0:
prog.insert(RZ(qubit_list[0],coef*t))
return prog