Closed overshiki closed 2 years ago
Hi, overshiki.
Maybe you could try this:
function hamiltonian()
X1 = put(3, 1=>X)
X2 = put(3, 2=>X)
Z3 = put(3, 3=>Z)
I = put(3, 1=>I2)
return 0.13*I + 0.6*X1*Z3 + 0.3*X2*Z3
end
Hi @ChenZhao44, Yes, this solves my problem. Thanks!
Hi, I'm trying to use Yao.jl in the field of quantum chemistry. I just encountered a problem that I do not know how to write an empty Pauli string inside a Hamiltonian. More specifically, I need to write down the following Hamiltonian, for example:
Following this example, I know that
0.6*X1*I2*Z3 + 0.3*I1*X2*Z3
could be defined in this way:But how about
0.13*I1*I2*I3
? I tried0.13 + 0.6*X1*Z3 + 0.3*X2Z3
, however, it doesn't work. I think it must be an easy task, but I could not find any related document.