Closed wzy7178 closed 1 year ago
I also find the noiseless VQE code shown in the readme.md is not fully working on my laptop, and Julia say the function rayleigh_quotient
is not defined. I have to find the function on GitHub and put it into my program. Moreover, in the current version on the GitHub, it is defined as
function rayleigh_quotient(O::MPO, U::Vector{ITensor}, ψ::MPS; kwargs...) Uψ = runcircuit(ψ, U; kwargs...) return real(ITensors.inner(Uψ, O, Uψ)) end
which is not compatible with the newest ITensor version. After I replace it with
return real(ITensors.inner((Uψ)', O, Uψ))
if finally worked.
I think the error is caused by the function nqubits
, defined as the following:
nqubits(gate::Tuple) = maximum(Ops.sites(Op(gate)))
Ops.sites
will return ( )
when given a circuit defined in the example in readme.md.
Thanks for the report, this is actually broken even in the most minimal example of runcircuit
:
runcircuit([("X", 1)])
This was broken by a big internal change we made to the operator algebra system in ITensors.jl: https://github.com/ITensor/ITensors.jl/pull/920 which we was include in ITensors 0.3.14. Unfortunately some of behavior changed which we were using in PastaQ and broke the functionality for parsing the gate list, as you identified.
I made a patch here: https://github.com/GTorlai/PastaQ.jl/pull/292 which will be included in the next PastaQ release (PastaQ 0.0.24).
Many thanks!
Ok it should be fixed in PastaQ 0.0.24, please let me know if it works and I'll close this issue.
Dear PastaQ developer(s): Today I tried to use PastaQ to do a noisy VQE, and first checked if the noisy circuit function works on my computer. However, when running the noisy circuit example you provide in the readme.md file, I find the following error (see the log below).
This error appears on my Mac (native M1 Julia build) and an Linux cluster. And the same error occurs when I run the testsets in the
test_noise.jl
.Hope to learn about what causes this, thanks!