Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
name = "QuestBase"
uuid = "7e80f742-43d6-403d-a9ea-981410111d43"
authors = ["Orjan Ameye <orjan.ameye@hotmail.com>", "Jan Kosata <kosataj@phys.ethz.ch>", "Javier del Pino <jdelpino@phys.ethz.ch>"]
version = "0.4.0"
authors = ["Orjan Ameye <orjan.ameye@hotmail.com>", "Jan Kosata <kosataj@phys.ethz.ch>", "Javier del Pino <jdelpino@phys.ethz.ch>"]

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Moshi = "2e0e35c7-a2e4-4343-998d-7ef72827ed2d"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"

[compat]
Aqua = "0.8.11"
CheckConcreteStructs = "0.1.0"
DocStringExtensions = "0.9.4"
ExplicitImports = "1.11"
JET = "0.9.18, 0.10.0, 0.11"
LinearAlgebra = "1.10"
Moshi = "0.3.7"
OrderedCollections = "1.8"
Random = "1.10"
SymbolicUtils = "4"
Symbolics = "7"
julia = "1.10"
Random = "1.10"
LinearAlgebra = "1.10"
Test = "1.10"
OrderedCollections = "1.8"
Aqua = "0.8.11"
ExplicitImports = "1.11"
JET = "0.9.18, 0.10.0, 0.11"
CheckConcreteStructs = "0.1.0"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
CheckConcreteStructs = "73c92db5-9da6-4938-911a-6443a7e94a58"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
27 changes: 5 additions & 22 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@ using QuestBase:
fourier_sin_term,
drop_powers,
max_power,
power_of,
substitute_all,
is_harmonic,
is_function,
count_derivatives,
add_div,
DifferentialEquation,
HarmonicVariable,
HarmonicEquation,
add_harmonic!,
rearrange_standard!,
d,
var_name
d
using Symbolics: Symbolics, @variables, unwrap, expand, Num, Equation, Differential
using SymbolicUtils: BasicSymbolic

Expand Down Expand Up @@ -63,10 +60,7 @@ SUITE["symbolic_utils"]["_apply_termwise_div"] = @benchmarkable _apply_termwise(
simplify_complex, $(unwrap((a^2 + b * c + c^3) / (a * b + c^2)))
)

SUITE["symbolic_utils"]["simplify_complex_add"] = @benchmarkable simplify_complex(
$(unwrap(Complex{Num}(a^2 + b * c, 0 * a)))
)
SUITE["symbolic_utils"]["simplify_complex_real"] = @benchmarkable simplify_complex(
SUITE["symbolic_utils"]["simplify_complex"] = @benchmarkable simplify_complex(
$(Complex{Num}(a^2 + b * c, 0 * a))
)

Expand All @@ -79,20 +73,10 @@ SUITE["symbolic_utils"]["get_independent_trig"] = @benchmarkable get_independent

SUITE["symbolic_utils"]["get_all_terms_nested"] = @benchmarkable get_all_terms($expr_nested)

SUITE["symbolic_utils"]["is_function_true"] = @benchmarkable is_function(
$(cos(f * t)^2 + a), $t
)
SUITE["symbolic_utils"]["is_function_false"] = @benchmarkable is_function(
$(a^2 + b * c), $t
)

SUITE["symbolic_utils"]["count_derivatives_0"] = @benchmarkable count_derivatives($x)
SUITE["symbolic_utils"]["count_derivatives_2"] = @benchmarkable count_derivatives(
SUITE["symbolic_utils"]["count_derivatives"] = @benchmarkable count_derivatives(
$(d(d(x, t), t))
)

SUITE["symbolic_utils"]["var_name"] = @benchmarkable var_name($x)

# ==========================================================================
# Exponentials
# ==========================================================================
Expand Down Expand Up @@ -120,8 +104,8 @@ trig_expr_hard = (a + b * cos(f * t + θ)^2)^3 * sin(f * t)
SUITE["fourier"]["trig_to_exp_sq"] = @benchmarkable trig_to_exp($trig_expr_sq)
SUITE["fourier"]["trig_to_exp_product"] = @benchmarkable trig_to_exp($trig_expr_product)

exp_sum = unwrap(exp(im * a) + exp(-im * a) + exp(im * (a + b)))
SUITE["fourier"]["exp_to_trig_sum"] = @benchmarkable exp_to_trig($exp_sum)
exp_sum = trig_to_exp(a * cos(f * t) + b * sin(2f * t))
SUITE["fourier"]["exp_to_trig"] = @benchmarkable exp_to_trig($exp_sum)

SUITE["fourier"]["add_div"] = @benchmarkable add_div($(a / (b + c) + b / (a + c)))

Expand Down Expand Up @@ -151,7 +135,6 @@ SUITE["powers"] = BenchmarkGroup()

SUITE["powers"]["max_power_simple"] = @benchmarkable max_power($(a^2 + b), $a)
SUITE["powers"]["max_power_nested"] = @benchmarkable max_power($(a * ((a + b)^4)^2 + a), $a)
SUITE["powers"]["power_of_pow"] = @benchmarkable power_of($(unwrap(a^3)), $(unwrap(a)))
SUITE["powers"]["drop_powers_single_var"] = @benchmarkable drop_powers(
$((a + b)^3 + a^2 * b + a * b^2), $a, 2
)
Expand Down
Loading
Loading