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
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@ language: julia
os:
- linux
julia:
- 0.6
- 1.3
- 1.4
notifications:
email: false
before_install:
- sudo apt-get install hdf5-tools
# - sudo apt-get install hdf5-tools
# uncomment the following lines to override the default test script
#script:
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
# - julia -e 'Pkg.clone(pwd()); Pkg.build("silly"); Pkg.test("silly"; coverage=true)'
- julia -e 'Pkg.add("Conda")'
- julia -e 'using Conda;
Conda.add("pip");
pip = joinpath(Conda.BINDIR, "pip");
run(`$pip install https://github.com/BBN-Q/QGL.git`)'

after_success:
# push coverage results to Codecov
- julia -e 'cd(Pkg.dir("silly")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
178 changes: 178 additions & 0 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# This file is machine-generated - editing it directly is not advised

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[Blosc]]
deps = ["Blosc_jll"]
git-tree-sha1 = "84cf7d0f8fd46ca6f1b3e0305b4b4a37afe50fd6"
uuid = "a74b3585-a348-5f62-a45c-50e91977d574"
version = "0.7.0"

[[Blosc_jll]]
deps = ["Libdl", "Lz4_jll", "Pkg", "Zlib_jll", "Zstd_jll"]
git-tree-sha1 = "aa9ef39b54a168c3df1b2911e7797e4feee50fbe"
uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9"
version = "1.14.3+1"

[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "48c20c43e157c6eab6cf88326504ec042b05e456"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.10.0"

[[Conda]]
deps = ["JSON", "VersionParsing"]
git-tree-sha1 = "7a58bb32ce5d85f8bf7559aa7c2842f9aecf52fc"
uuid = "8f4d0f93-b110-5947-807f-2305c1781a2d"
version = "1.4.1"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"

[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[HDF5]]
deps = ["Blosc", "HDF5_jll", "Libdl", "Mmap", "Random"]
git-tree-sha1 = "7048678fa1970aaf867f3e99b90f3e85a9847124"
uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
version = "0.13.2"

[[HDF5_jll]]
deps = ["Libdl", "Pkg", "Zlib_jll"]
git-tree-sha1 = "85bd2e586a10ae0eab856125bf5245e0d36384a7"
uuid = "0234f1f7-429e-5d53-9886-15a909be8d59"
version = "1.10.5+5"

[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.0"

[[LibGit2]]
deps = ["Printf"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[LinearAlgebra]]
deps = ["Libdl"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[Lz4_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "e1a93171a400d4578193eaa39edd2d3f5db08fb6"
uuid = "5ced341a-0733-55b8-9ab6-a4889d929147"
version = "1.9.2+0"

[[MacroTools]]
deps = ["Markdown", "Random"]
git-tree-sha1 = "f7d2e3f654af75f01ec49be82c231c382214223a"
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
version = "0.5.5"

[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[Parsers]]
deps = ["Dates", "Test"]
git-tree-sha1 = "f0abb338b4d00306500056a3fd44c221b8473ef2"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "1.0.4"

[[Pkg]]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[PyCall]]
deps = ["Conda", "Dates", "Libdl", "LinearAlgebra", "MacroTools", "Serialization", "VersionParsing"]
git-tree-sha1 = "3a3fdb9000d35958c9ba2323ca7c4958901f115d"
uuid = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
version = "1.91.4"

[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[[VersionParsing]]
git-tree-sha1 = "80229be1f670524750d905f8fc8148e5a8c4537f"
uuid = "81def892-9a0e-5fdd-b105-ffc91e053289"
version = "1.2.0"

[[YAML]]
deps = ["Base64", "Dates", "Printf"]
git-tree-sha1 = "c5e2eaa5ce818c5277388377d592eb4c81f27c00"
uuid = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
version = "0.4.0"

[[Zlib_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "a2e0d558f6031002e380a90613b199e37a8565bf"
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
version = "1.2.11+10"

[[Zstd_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "f23995a6ab76d634865204fe0a4e7254d1a6d1f9"
uuid = "3161d3a3-bdf6-5164-811a-617609db77b4"
version = "1.4.4+1"
12 changes: 12 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name = "QGL"
uuid = "ad0c24d0-9e87-4ecb-bb43-4b3bae5867a1"
authors = ["Colm Ryan", "Blake Johnson"]
licence = "Apache"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ The package is not yet registered with METADATA.jl and so must be cloned with
Pkg.clone("https://github.com/BBN-Q/QGL.jl.git")
```

### QGL dependency

The SQLite database structure is managed by the python implementation of QGL.
This adds to the dependencies but reduces the amount of duplicated work QGL.jl
has to do in collecting the qubit control meta-data. To install QGL and its
deps:

```julia
using Conda
Conda.add("pip")
pip = joinpath(Conda.BINDIR, "pip")
run(`$pip install path/to/local/QGL`) # or
run(`$pip install https://github.com/BBN-Q/QGL.git`)
```

## Benchmarks

Preliminary benchmarks show speed-ups for Python QGL of ~25-30X.
Expand Down
4 changes: 0 additions & 4 deletions REQUIRE

This file was deleted.

2 changes: 1 addition & 1 deletion cfg/test_measure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ qubits:
frequency: -50e6
pulse_params:
cutoff: 2.0
length: 200e-9
length: 200e-09
pi2Amp: 0.45
piAmp: 0.8767
shape_fun: drag
Expand Down
49 changes: 46 additions & 3 deletions src/APS2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const PREFETCH = 0x0c

const APS2Instruction = UInt64

immutable Waveform
struct Waveform
address::UInt32
count::UInt32
isTA::Bool
Expand All @@ -63,7 +63,7 @@ function Waveform(address, count, isTA, write_flag)
Waveform(addr, ct, isTA, write_flag, instr)
end

immutable Marker
struct Marker
engine_select::UInt8
state::Bool
count::UInt32
Expand All @@ -89,7 +89,7 @@ function Marker(marker_select, count, state, write_flag)
Marker(UInt8(marker_select), state, quad_count, transition_word, write_flag, instr)
end

immutable ControlFlow
struct ControlFlow
instruction::UInt64
end

Expand Down Expand Up @@ -349,6 +349,49 @@ function write_to_file(filename, instrs, wfs)
end
filename = joinpath(seq_path, filename)

open(filename, "w") do FID
write(FID, b"APS2") # target
write(FID, b"4.0") # version
write(FID, b"4.0") # min firmware version
write(FID, UInt16(2)) # number of channels
# write instruction data
write(FID, UInt64(legnth(instrs)))
write(FID, map(UInt8, instrs))

# because we only support the APS2 for now, limit to
# specifically two channels
write(FID, UInt64(length(wf_vec)))
write(FID, map(UInt8, real(wf_vec)))

write(FID, UInt64(length(wf_vec)))
write(FID, map(UInt8, imag(wf_vec)))
end
end

"""
Depricated function for writing to h5 files
"""
function write_to_h5(filename, instrs, wfs)
# flatten waveforms to vector
wf_vec = Vector{Complex{Int16}}()
if !isempty(wfs)
resize!(wf_vec, sum(length(wf) for wf in wfs))
idx = 1
for wf in wfs
wf_vec[idx:idx+length(wf)-1] = wf
idx += length(wf)
end
end

#prepend the sequence directory
seq_name_dir = filename[1:match(r"-", filename).offset-1]
seq_path = joinpath(config.sequence_files_path, seq_name_dir)
# create the sequence directory if necessary
if !isdir(seq_path)
mkpath(seq_path)
end
filename = joinpath(seq_path, filename)

h5open(filename, "w") do f
attrs(f)["Version"] = 4.0
attrs(f)["target hardware"] = "APS2"
Expand Down
10 changes: 5 additions & 5 deletions src/channels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ show(io::IO, c::Channel) = print(io, c.label)
"""
Channel representing single qubit drive.
"""
immutable Qubit <: Channel
struct Qubit <: Channel
label::String
awg_channel::String
gate_channel::String
Expand Down Expand Up @@ -52,7 +52,7 @@ end
"""
Channel representing a digital output marker line.
"""
immutable Marker <: Channel
struct Marker <: Channel
label::String
awg_channel::String
shape_params::Dict{Any, Any}
Expand All @@ -68,7 +68,7 @@ function Marker(label)
end

# NOTE is this mutable on purpose??
type QuadratureAWGChannel
mutable struct QuadratureAWGChannel
awg::String
delay::Real
mixer_correction::Matrix{Real}
Expand All @@ -81,7 +81,7 @@ hash(c::Channel, h::UInt) = hash(c.label, h)
"""
Channel representing qubit measurement drive
"""
immutable Measurement <: Channel
struct Measurement <: Channel
label::String
awg_channel::String
gate_channel::String
Expand Down Expand Up @@ -112,7 +112,7 @@ end
"""
Channel representing an interaction drive.
"""
immutable Edge <: Channel
struct Edge <: Channel
label::String
source::Qubit
target::Qubit
Expand Down
Loading