Skip to content

chenspc/QDScan.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QDScan

Stable Dev Build Status Build Status Coverage

A package for generating input files for QuantumDetectors Scan Engine.

Installation

Install Julia

Downloads and Documentation

Install QDScan.jl

Press ] in a Julia REPL to access package mode, then for using the package:

pkg> add [email protected]:chenspc/QDScan.jl.git

or for development:

pkg> dev [email protected]:chenspc/QDScan.jl.git

Patterns

Raster

p = make_pattern(8, 8; pattern="raster", visual="lineplot");

qdscan_example_raster

Serpentine

p = make_pattern(8, 8; pattern="serpentine", visual="lineplot");

qdscan_example_serpentine

Hilbert

p = make_pattern(8, 8; pattern="hilbert", visual="lineplot");

qdscan_example_hilbert

Spiral

p = make_pattern(8, 8; pattern="spiral", visual="lineplot");

qdscan_example_spiral

Interleave

p = make_pattern(8, 8, 2; pattern="interleave", visual="heatmap");
p = make_pattern(9, 9, 3; pattern="interleave", visual="heatmap");
p = make_pattern(6, 6, (2, 3); pattern="interleave", visual=["matrix", "heatmap"]);

qdscan_example_interleave

Random

p = make_pattern(16, 16; pattern="random", visual="heatmap", seed=1234);

qdscan_example_random

Sparse

p = make_pattern(10, 10, 0.1; pattern="sparse", visual=["matrix", "heatmap"], seed=1234);

make_pattern(10, 10; pattern="sparse", visual="heatmap") == make_pattern(10, 10, 0.5; pattern="sparse", visual="heatmap", seed=2023)

qdscan_example_sparse

Premade patterns

  • Any matrix with positive integer elements that do not repeat can be converted into a pattern. Simply give the matrix as the first input to make_pattern.
  • Julia matrices are column major, counting first from top to bottom, while scan patterns are typically displayed from left to right first, hence appearing transposed after the make_pattern function.
  • QD Scan Engine use 0-based index, so the pattern coordinates need to subtract 1, or (1, 1).
  • QD Scan Engine accepts either coordinates as (x, y) or x + y*x_size. Use the optional linear_index variable to toggle the output.
julia> A = random_pattern(2, 3)
2×3 Matrix{Int64}:
 5  4  1
 6  3  2

julia> p = make_pattern(A; pattern="premade")
3×2 adjoint(::Matrix{Int64}) with eltype Int64:
 5  6
 4  3
 1  2
6-element Vector{Tuple{Int64, Int64}}:
 (0, 2)
 (1, 2)
 (1, 1)
 (0, 1)
 (0, 0)
 (1, 0)

julia> p = make_pattern(A; pattern="premade", linear_index=true)
3×2 adjoint(::Matrix{Int64}) with eltype Int64:
 5  6
 4  3
 1  2
6-element Vector{Int64}:
 4
 5
 3
 2
 0
 1

Repeat a pattern

Repeat at the same position before moving on to the next position

The make_pattern function can accept a complex matrix as input. When an element is real, the probe will stop for one dwell period before moving onto the next. A complex element in the matrix, e.g. 4 + 2im means dwelling at position 4 for 3 periods (1 default + 2 additional).

julia> B = A .+ 2im
2×3 Matrix{Complex{Int64}}:
 5+2im  4+2im  1+2im
 6+2im  3+2im  2+2im

julia> ppp = make_pattern(B; pattern="premade", linear_index=true)
3×2 adjoint(::Matrix{Int64}) with eltype Int64:
 5  6
 4  3
 1  2
18-element Vector{Int64}:
 4
 4
 4
 5
 5
 5
 3
 3
 3
 2
 2
 2
 0
 0
 0
 1
 1
 1

Multiple passes of the same pattern (including multiple frames if the matrix is complex)

One can also simply repeat the whole pattern by providing the optional multipass variable

julia> px3 = make_pattern(A; pattern="premade", linear_index=true, multipass=3)
3×2 adjoint(::Matrix{Int64}) with eltype Int64:
 5  6
 4  3
 1  2
18-element Vector{Int64}:
 4
 5
 3
 2
 0
 1
 4
 5
 3
 2
 0
 1
 4
 5
 3
 2
 0
 1

Save pattern to file

save_pattern("test_pattern.csv", p)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages