You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to solve the example of the package as follows:
using DifferentialEquations, Yao, QuantumNLDiffEq
# Making the ODEProblem
function f(u, p, t)
λ, κ = p
return -1*λ*u*(κ + tan(λ*t))
end
prob = ODEProblem(f, [1.0], (0.0, 0.9), [8.0, 0.1])
function loss_func(a, b)
return (a - b)^2
end
#Making the DQC
DQC = [QuantumNLDiffEq.DQCType(afm = QuantumNLDiffEq.ChebyshevTower(2), fm = chain(6, [put(i=>Ry(0)) for i in 1:6]), cost = [Add([put(6, i=>Z) for i in 1:6])], var = dispatch(EasyBuild.variational_circuit(6,5), :random), N = 6)]
config = DQCConfig(abh = QuantumNLDiffEq.Floating(), loss = loss_func)
M = range(start=0; stop=0.9, length=21)
evalue(M) = [QuantumNLDiffEq.calculate_evalue(DQC[1], DQC[1].cost, prob.u0[1], config.abh, params[1], M[x], M[1]) for x in 1:length(M)]
params = [Yao.parameters(DQC[1].var)]
#Training the circuit
QuantumNLDiffEq.train!(DQC, prob, config, M, params, steps = 1000)
This error happened even though I tried with Julia 1.8, 1.9, or 1.10 for ChebyshevTower and ChebyshevSparse and did not happen for Product
Please help me on how to fix it.
The text was updated successfully, but these errors were encountered:
@HuynhTran0301 Ah, sorry for the long wait. I was unaware of the issues opened.
I'll take a deeper look at both this and your other issue tomorrow. Feel free to ping me for any issues or questions regarding this repo henceforth.
I tried to solve the example of the package as follows:
I got the error as follows:
This error happened even though I tried with Julia 1.8, 1.9, or 1.10 for
ChebyshevTower
andChebyshevSparse
and did not happen forProduct
Please help me on how to fix it.
The text was updated successfully, but these errors were encountered: