Skip to content

Commit

Permalink
Merge pull request #12 from QuEraComputing/abstract-base-refactor
Browse files Browse the repository at this point in the history
Abstract base refactor
  • Loading branch information
weinbe58 authored Dec 20, 2023
2 parents c0cb03a + 7c8aa53 commit 14d2f63
Show file tree
Hide file tree
Showing 14 changed files with 1,678 additions and 82 deletions.
6 changes: 3 additions & 3 deletions benchmarks/rabi-dormand-prince.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using BenchmarkTools
using DormandPrince:DP5Solver, dopri5
using DormandPrince:DP5Solver, core_integrator

function fcn(x, y, f)
g(x) = 2.2*2π*sin(2π*x)
Expand All @@ -14,6 +14,6 @@ solver = DP5Solver(
ComplexF64[1.0, 0.0]
)

dopri5(solver, 2π)
core_integrator(solver, 2π)

@benchmark dopri5(clean_solver, 2π) setup=(clean_solver = DP5Solver(fcn, 0.0, ComplexF64[1.0, 0.0])) samples=10000 evals=5 seconds=500
@benchmark core_integrator(clean_solver, 2π) setup=(clean_solver = DP5Solver(fcn, 0.0, ComplexF64[1.0, 0.0])) samples=10000 evals=5 seconds=500
20 changes: 20 additions & 0 deletions benchmarks/type_stab.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using DormandPrince: DP5Solver, integrate
using JET: @report_opt


function fcn(x, y, f)
g(x) = 2.2*2π*sin(2π*x)

f[1] = -1im * g(x)/2 * y[2]
f[2] = -1im * g(x)/2 * y[1]
end

solver = DP5Solver(
fcn,
0.0,
ComplexF64[1.0, 0.0]
)

@report_opt integrate(solver, 2π)


Loading

0 comments on commit 14d2f63

Please sign in to comment.