Skip to content
Merged
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
74 changes: 62 additions & 12 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,69 @@
env:
CODECOV_TOKEN: c078b8d5-ad2b-4c0d-a5c7-ac8266f699bc
JULIA_NUM_THREADS: auto

CODECOV_TOKEN: 6dfc8e6b-e2fe-4715-be78-a8d1c61bfb17
JULIA_NUM_THREADS: auto,auto
PYTHON: ""
PYCALL_DEBUG_BUILD: yes

steps:
- label: "CI Buildkite"
- label: "Tests - {{matrix.LABEL}}"
plugins:
- JuliaCI/julia#v1:
version: "1"
- QuantumSavory/julia-xvfb#v1:
- JuliaCI/julia-test#v1: ~
compiled_size_limit: 10737418240 # 10GiB
- JuliaCI/julia-test#v1:
- JuliaCI/julia-coverage#v1:
codecov: true
command: |
julia -e '
using Pkg
Pkg.add("QuantumSavory")
Pkg.build("QuantumSavory")
Pkg.test("QuantumSavory")'
dirs: './src,./ext'
commands:
- echo "Julia depot path $${JULIA_DEPOT_PATH}"
- echo "TERM=$${TERM} | PYTHON=$${PYTHON} | PYCALL_DEBUG_BUILD=$${PYCALL_DEBUG_BUILD}"
env:
JET_TEST: "{{matrix.JET_TEST}}"
agents:
queue: "{{matrix.QUEUE}}"
matrix:
setup:
LABEL: ["base tests"]
QUEUE: ["default"]
JET_TEST: ["false"]
adjustments:
- with:
LABEL: "JET"
QUEUE: default
JET_TEST: true

- label: "Downstream Tests - {{matrix.PACKAGE}}"
plugins:
- JuliaCI/julia#v1:
version: "1"
compiled_size_limit: 10737418240 # 10GiB
command:
- echo "Julia depot path $${JULIA_DEPOT_PATH}"
- echo "TERM=$${TERM} | PYTHON=$${PYTHON} | PYCALL_DEBUG_BUILD=$${PYCALL_DEBUG_BUILD}"
- julia --project=$(mktemp -d) -e '
using Pkg;
pkg"dev .";
Pkg.add("{{matrix.PACKAGE}}");
Pkg.build("{{matrix.PACKAGE}}");
Pkg.test("{{matrix.PACKAGE}}");'
matrix:
setup:
PACKAGE: ["QuantumSavory"]

- label: "Downstream Dev Tests - {{matrix.PACKAGE}}"
plugins:
- JuliaCI/julia#v1:
version: "1"
compiled_size_limit: 10737418240 # 10GiB
command:
- echo "Julia depot path $${JULIA_DEPOT_PATH}"
- echo "TERM=$${TERM} | PYTHON=$${PYTHON} | PYCALL_DEBUG_BUILD=$${PYCALL_DEBUG_BUILD}"
- julia --project=$(mktemp -d) -e '
using Pkg;
pkg"dev .";
Pkg.develop("{{matrix.PACKAGE}}");
Pkg.build("{{matrix.PACKAGE}}");
Pkg.test("{{matrix.PACKAGE}}");'
matrix:
setup:
PACKAGE: ["QuantumSavory"]
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ uuid = "efa7fd63-0460-4890-beb7-be1bbdfbaeae"
authors = ["QuantumSymbolics.jl contributors"]
version = "0.4.12-dev"

[workspace]
projects = ["benchmark", "docs"]

[deps]
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
1 change: 1 addition & 0 deletions benchmark/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
QuantumClifford = "0525e862-1e90-11e9-3e4d-1b39d7109de1"
QuantumOpticsBase = "4f57444f-1401-5e15-980d-4471b28d5678"
QuantumSymbolics = "efa7fd63-0460-4890-beb7-be1bbdfbaeae"
14 changes: 0 additions & 14 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,6 @@ using BenchmarkTools
const SUITE = BenchmarkGroup()
@ket k1; @ket k2; @bra b1; @bra b2; @op A; @op B; @op C;

# Time to import and first usage of simple operations
SUITE["latency"] = BenchmarkGroup(["slow"])
load_command = `julia --quiet --project=./ --eval="using QuantumSymbolics"`
ttfx_command = `
julia --quiet --project=./ --eval="""
using QuantumSymbolics;
@ket k1; @op A;
A * commutator(A,X) * k1
"""`
SUITE["latency"]["using"] = @benchmarkable run(load_command) samples=3 seconds=15
SUITE["latency"]["ttf_operation"] = @benchmarkable run(ttfx_command) samples=3 seconds=15
SUITE["latency"]["ttf_simplify"] = @benchmarkable qsimplify(X*Y) samples=1 evals=1


# Symbolic object creation
SUITE["creation"] = BenchmarkGroup(["symbolic"])
SUITE["creation"]["ket"] = @benchmarkable @ket _k
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Gabs = "0eb812ee-a11f-4f5e-b8d4-bb8a44f06f50"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
QuantumClifford = "0525e862-1e90-11e9-3e4d-1b39d7109de1"
QuantumInterface = "5717a53b-5d69-4fa3-b976-0bf2f97ca1e5"
QuantumOptics = "6e0679c1-51ea-5a7c-ac74-d61b76210b0c"
Expand Down
35 changes: 23 additions & 12 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
using TestItemRunner
using QuantumSymbolics
using TestItemRunner

JET_flag = false

if get(ENV, "JET_TEST", "") != "true"
@info "Skipping JET tests -- must be explicitly enabled."
@info "Environment must set JET_TEST=true."
else
JET_flag = true
end

using Pkg
JET_flag && Pkg.add("JET")

# filter for the test
testfilter = ti -> begin
exclude = Symbol[:jet]
if !(VERSION >= v"1.10")
push!(exclude, :doctests)
push!(exclude, :aqua)
end
exclude = Symbol[]
if !JET_flag
push!(exclude, :jet)
end
if !(VERSION >= v"1.10")
push!(exclude, :doctests)
push!(exclude, :aqua)
end

return all(!in(exclude), ti.tags)
return all(!in(exclude), ti.tags)
end

println("Starting tests with $(Threads.nthreads()) threads out of `Sys.CPU_THREADS = $(Sys.CPU_THREADS)`...")

@run_package_tests filter=testfilter

if get(ENV,"JET_TEST","")=="true"
@run_package_tests filter=(ti -> :jet in ti.tags)
end
@run_package_tests filter=testfilter
22 changes: 8 additions & 14 deletions test/test_jet.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
@testitem "JET checks" tags=[:jet] begin
using JET
using QuantumOptics, QuantumClifford # to load the extensions
using JET
using QuantumOptics, QuantumClifford # to load the extensions
using Test
using QuantumSymbolics

using InteractiveUtils, Latexify, SymbolicUtils

rep = report_package("QuantumSymbolics";
ignored_modules=(
AnyFrameModule(InteractiveUtils),
AnyFrameModule(Latexify),
AnyFrameModule(SymbolicUtils)
)
)
@show rep
@test_broken length(JET.get_reports(rep)) == 0
@test length(JET.get_reports(rep)) <= 6
rep = JET.report_package(QuantumSymbolics, target_modules=[QuantumSymbolics])
@show rep
@test_broken length(JET.get_reports(rep)) == 0
@test length(JET.get_reports(rep)) <= 6
end
Loading