We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8805e0 commit 6e3b34dCopy full SHA for 6e3b34d
examples/VQE/H2.jl
@@ -10,13 +10,6 @@ function hydrogen_hamiltonian()
10
0.011280*Z1*Z2 + 0.397936*Z1 + 0.397936*Z2 + 0.180931*X1*X2
11
end
12
13
-function get_gradient(circ, hamiltonian)
14
- ψ = zero_state(2) |> circ
15
- dψ = copy(ψ) |> hamiltonian
16
- backward!((copy(ψ), dψ), circ)
17
- gradient(circ)
18
-end
19
-
20
using Flux: Optimise
21
function train!(circ, hamiltonian; optimizer, niter::Int=100)
22
params = parameters(circ)
0 commit comments