Skip to content
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
472d37a
add a pow block to yaoblocks
harry-phasecraft Mar 30, 2026
107b2a1
add missing files oops
harry-phasecraft Mar 30, 2026
3588d6d
Merge branch 'master' into master
harry-phasecraft Apr 1, 2026
247bd55
bump version
harry-phasecraft Apr 2, 2026
e52ef80
add missing exports
harry-phasecraft Apr 2, 2026
423e4fb
write a mat_back function
harry-phasecraft Apr 3, 2026
31b4d4f
some pr fixes
harry-phasecraft Apr 7, 2026
95fdbe6
remove lambda
harry-phasecraft Apr 7, 2026
e76b506
Merge pull request #1 from QuantumBFS/master
jlbosse Apr 10, 2026
ea59fa7
PowBlock -> Power
harry-phasecraft Apr 15, 2026
d8662f2
rename files
harry-phasecraft Apr 15, 2026
8406a46
remove alternate constructor
harry-phasecraft Apr 15, 2026
d33538b
improve test coverage
harry-phasecraft Apr 15, 2026
984d894
fix missing rename
harry-phasecraft Apr 15, 2026
74f3647
add println test
harry-phasecraft Apr 15, 2026
5caacac
remove erroneous export
harry-phasecraft Apr 15, 2026
754c0ee
add lambda version of power
harry-phasecraft Apr 16, 2026
b846a36
add test for color
harry-phasecraft Apr 16, 2026
c488cc2
add a to_basictypes
harry-phasecraft Apr 16, 2026
4aaef2f
add dump and map_address
harry-phasecraft Apr 16, 2026
7e11795
add eigenbasis
harry-phasecraft Apr 16, 2026
19401bf
Update lib/YaoBlocks/src/composite/power.jl
harry-phasecraft Apr 27, 2026
e434889
fixed pow==0 cases and eigenbasis
Jul 1, 2026
a4195c8
Merge branch 'master' into master
jlbosse Jul 1, 2026
727acd9
addressed review comments
Sep 22, 2026
e72953e
Merge branch 'master' into master
jlbosse Sep 22, 2026
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Yao"
uuid = "5872b779-8223-5990-8dd0-5abbb0748c8c"
version = "0.9.3"
version = "0.9.4"

[deps]
BitBasis = "50ba71b6-fa0f-514d-ae9a-0916efc90dcf"
Expand Down
3 changes: 2 additions & 1 deletion lib/YaoBlocks/src/algebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ Base.sum(blocks::AbstractVector{<:AbstractBlock{D}}) where D = Add(blocks)
Base.:(-)(lhs::AbstractBlock, rhs::AbstractBlock) = Add(lhs, -rhs)

# pow
Base.:(^)(x::AbstractBlock, n::Int) = chain((copy(x) for k = 1:n)...)
Base.:(^)(x::AbstractBlock, n) = Power(x, n)
Base.literal_pow(f::typeof(^), x::AbstractBlock, ::Val{p}) where {p} = Power(x, p)
12 changes: 12 additions & 0 deletions lib/YaoBlocks/src/autodiff/apply_back.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ function apply_back!(st, circuit::AbstractAdd, collector; in)
(in, inδ)
end

function apply_back!(st, block::Power{D, BT, PT}, collector) where {D, BT<:AbstractBlock, PT<:Integer}
iszero(block.pow) && return st
blk = block.pow > 0 ? content(block) : adjoint(content(block))
res = Any[]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike ChainBlock we know what the content of PowBlock is. So can we maybe be more specific than Any here because we exactly know what will end up in res?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just discussed this and concluded that e.g. RepeatedBlock does the same Any, so this should be fine.

for _ in 1:abs(block.pow)
st = apply_back!(st, blk, res)
end
np = nparameters(blk)
prepend!(collector, [sign(block.pow) * sum(res[i:np:end]) for i in 1:np])
return st
end

function apply_back!(st, block::RepeatedBlock{D,C}, collector) where {D,C}
if nparameters(content(block)) == 0
return apply!.(st, Ref(block'))
Expand Down
17 changes: 17 additions & 0 deletions lib/YaoBlocks/src/autodiff/mat_back.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,23 @@ function mat_back!(::Type{T}, rb::KronBlock, adjy, collector) where {T}
return collector
end

function mat_back!(::Type{T}, rb::Power{D, BT, PT}, adjy, collector) where {T, D, BT<:AbstractBlock, PT<:Integer}
nparameters(rb) == 0 && return collector
Comment thread
harry-phasecraft marked this conversation as resolved.
Resolved
blk = content(rb)
adjy = rb.pow > 0 ? adjy : adjy'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is correct, AFAICT adjy is an external input that we accumulate matrix gradients on? So I don't think we need to conjugate here. Instead I believe we should do

   blk = rb.pow > 0 ? content(rb) : content(rb)'

above.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wouldnt disagree except that i couldnt get that to pass the tests and this did. The implemtation for Daggered also does this step

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GiggleLiu or @Roger-luo can maybe one of you weigh in here? We are both a little bit confused as to how mat_back! exactly should behave.

U = mat(T, blk)
U_adj = U'
n = abs(rb.pow)
adjb = adjy * (U_adj)^(n-1)
adjc = adjb
for _ in 1:n-1
adjb = U_adj * adjb * U
adjc += adjb
end
mat_back!(T, blk, adjc, collector)
return collector
end

function mat_back!(::Type{T}, rb::AbstractAdd, adjy, collector) where {T}
nparameters(rb) == 0 && return collector
for b in subblocks(rb)[end:-1:1]
Expand Down
1 change: 1 addition & 0 deletions lib/YaoBlocks/src/composite/composite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ include("put_block.jl")
include("repeated.jl")
include("subroutine.jl")
include("add.jl")
include("power.jl")

# tag blocks
include("tag/tag.jl")
Expand Down
50 changes: 50 additions & 0 deletions lib/YaoBlocks/src/composite/power.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
export Power

using LinearAlgebra
using LegibleLambdas

"""
Power{D,GT<:AbstractBlock,PT<:Real} <: AbstractContainer{GT,D}
Power(block, pow) -> Power

Repeat the same block `content` `pow` times
"""
struct Power{D,BT<:AbstractBlock,PT<:Integer} <: AbstractContainer{BT,D}
content::BT
pow::PT
end

function Power(content::BT, pow::PT) where {D,BT<:AbstractBlock{D},PT}
if pow isa Int && pow < 0 && !isunitary(content)
Comment thread
harry-phasecraft marked this conversation as resolved.
Resolved
throw(ArgumentError("negative power requires a unitary block"))
end
Power{D,BT,PT}(content, pow)
end
Power(content::LegibleLambda, pow::PT) where {PT} = @λ(n -> Power(content(n), pow))

nqudits(pb::Power) = nqudits(pb.content)
chsubblocks(pb::Power, blk::AbstractBlock) = Power(blk, pb.pow)
occupied_locs(pb::Power) = occupied_locs(pb.content)

function mat(::Type{T}, pb::Power{D}) where {T, D}
pb.pow == 0 && return IMatrix{T}(D^nqudits(pb.content))
pb.pow > 0 && return mat(T, pb.content)^pb.pow
return mat(T, adjoint(pb.content))^(-pb.pow) # unitary: U^(-n) = (U†)^n
end

function YaoAPI.unsafe_apply!(r::AbstractRegister, pb::Power{D}) where {D}
blk = pb.pow >= 0 ? pb.content : adjoint(pb.content)
for _ in 1:abs(pb.pow)
YaoAPI.unsafe_apply!(r, blk)
end
return r
end

function nparameters(pb::Power)
return iszero(pb.pow) ? 0 : nparameters(pb.content)
end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I am not sure of the iszero check is correct, or whether this should always just return nparameters(content(pb)). We'd have to check the parameter dispatching and reverse mode AD code then.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me the problem is that if pow is 0 then there are no parameters regardless of what the content is which means. Is this because it will mess with how you might think dispatch etc will work if this returns 0 ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We definitely want that dispatch!(circuit, rand(nparameters(circuit)) always works. And it seems to me this might be easier to achieve (that is: with fewer lines of code) if we always return nparameters(content(powblock)) here. This might also simplify the reverse mode AD logic, where we might be able to to avoid branching on pow == 0 and instead just end up with some empty for loops.

And conceptually I guess the thing is that block ^ 0 means "repeat block 0 times" and not "do nothing".

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the suggested changes now. Will need QuantumBFS/LuxurySparse.jl#82 though before it fully works.

Base.adjoint(pb::Power) = Power(adjoint(pb.content), pb.pow)
Base.:(==)(a::Power, b::Power) = a.pow == b.pow && a.content == b.content
Base.copy(pb::Power) = Power(pb.content, pb.pow)
cache_key(pb::Power) = (pb.pow, cache_key(pb.content))
PropertyTrait(::Power) = PreserveAll()
3 changes: 3 additions & 0 deletions lib/YaoBlocks/src/layout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ color(::Type{<:Add}) = :red
color(::Type{<:PutBlock}) = :cyan
color(::Type{<:RepeatedBlock}) = :cyan
color(::Type{<:GeneralMatrixBlock}) = :red
color(::Type{<:Power}) = :yellow

print_block(io::IO, g::PhaseGate) = print(io, "phase(", g.theta, ")")
print_block(io::IO, S::ShiftGate) = print(io, "shift(", S.theta, ")")
Expand All @@ -211,6 +212,8 @@ print_block(io::IO, c::Add) = printstyled(io, "+"; bold = true, color = color(Ad
print_block(io::IO, c::TagBlock) = nothing
print_block(io::IO, c::GeneralMatrixBlock) =
printstyled(io, c.tag; color = color(GeneralMatrixBlock))
print_block(io::IO, pb::Power) =
printstyled(io, "pow(", pb.pow, ")"; bold = true, color = color(Power))

function print_block(io::IO, c::Measure{D,K,OT}) where {D,K,OT}
strs = String[]
Expand Down
10 changes: 10 additions & 0 deletions lib/YaoBlocks/src/measure_ops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ function eigenbasis(op::ChainBlock)
end
end

function eigenbasis(op::Power)
b = op.pow >= 0 ? content(op) : adjoint(content(op))
E = chain(b.n)
blks = chain(b.n)
Ei, Vi = eigenbasis(b)
push!(E, fill(Ei, abs(op.pow))...)
push!(blks, fill(Vi, abs(op.pow))...)
return E, blks
end
Comment on lines +58 to +61

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The eigenvectors of U^n are those of U and the eigenvalues of U^n are the eigenvalues of U raised to the n-th power. So I think this should simply be

function eigenbasis(op::Power) 
    E, V = eigenbasis(content(op))
    return E ^ op.pow, V
end

where you need to check the E ^ op.pow part again. Currently it might return a Power block again, but we probably want a matblock with the eigenvalues (to the pow-th power) on the diagonal.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is solved now.


function eigenbasis(op::Add)
# detect commute operators
if simple_commute_eachother(subblocks(op))
Expand Down
4 changes: 4 additions & 0 deletions lib/YaoBlocks/src/treeutils/address_manipulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,7 @@ end
function map_address(blk::AbstractAdd, info::AddressInfo)
chsubblocks(blk, map(b -> map_address(b, info), subblocks(blk)))
end

function map_address(blk::Power, info::AddressInfo)
Power(map_address(content(blk), info), blk.pow)
end
4 changes: 4 additions & 0 deletions lib/YaoBlocks/src/treeutils/dump.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ function dump_gate(blk::Scale)
:($(factor(blk)) * $(dump_gate(blk.content)))
end

function dump_gate(blk::Power)
:($(dump_gate(blk.content)) ^ $(blk.pow))
end

function dump_gate(blk::Measure)
if blk.operator == ComputationalBasis()
MOP = :(Measure)
Expand Down
1 change: 1 addition & 0 deletions lib/YaoBlocks/src/treeutils/load.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function parse_ex(ex, info::ParseInfo)
::Nothing => nothing
:($g') => :($(parse_ex(g, info))')
:($a * $b) => :($(Number(a)) * $(parse_ex(b, info)))
:($a ^ $b) => :($(parse_ex(a, info)) ^ $(Integer(b)))
:(kron($(args...))) =>
:(kron($(parse_ex.(args, Ref(ParseInfo(1, info.version)))...)))
:(repeat($(exloc...)) => $g) => begin
Expand Down
5 changes: 5 additions & 0 deletions lib/YaoBlocks/src/treeutils/optimise.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ end
function to_basictypes(block::Subroutine{D,<:Measure}) where {D}
map_address(content(block), AddressInfo(nqudits(block), [block.locs...]))
end
function to_basictypes(block::Power)
@assert block.pow isa Integer
Comment thread
harry-phasecraft marked this conversation as resolved.
Resolved
blk = block.pow >= 0 ? content(block) : adjoint(content(block))
chain(nqudits(block.content), [blk for _ in 1:abs(block.pow)])
end
to_basictypes(block::Daggered) = Daggered(block.content)
to_basictypes(block::Scale) = Scale(block.alpha, block.content)
to_basictypes(block::KronBlock) =
Expand Down
14 changes: 14 additions & 0 deletions lib/YaoBlocks/test/autodiff/apply_back.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,17 @@ end
)
end
end

@testset "apply pow" begin
Random.seed!(5)
for reg0 in [rand_state(3), rand_state(3, nbatch = 10)]
for n in [-3,-2,-1,1,2,3]
Comment thread
harry-phasecraft marked this conversation as resolved.
Resolved
@test test_apply_back(reg0, Power(put(3, 1=>Rx(0.5)), n), 0.5, δ = 1e-5)
@test test_apply_back(
reg0, Power(put(3, 1:2=>kron(Rx(0.5), Ry(0.4))), n), [0.5, 0.4], δ = 1e-5
)
end
# pow=0 has no params and should just return the first argument
@test apply_back!((1,1), Power(put(3, 1=>Rx(0.5)), 0), []) == (1, 1)
end
end
15 changes: 15 additions & 0 deletions lib/YaoBlocks/test/autodiff/mat_back.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,18 @@ end
use_outeradj = use_outeradj,
)
end

@testset "mat pow" begin
use_outeradj = false
for n in [-3, -1, 1, 2, 3]
Comment thread
harry-phasecraft marked this conversation as resolved.
Resolved
@test test_mat_back(
ComplexF64,
Power(kron(Rx(0.5), Ry(0.5)), n),
[0.5, 0.5];
δ = 1e-5,
use_outeradj = use_outeradj,
)
end
# pow=0 has no params and should just return last arg
@test mat_back!(Float64, Power(put(3, 1=>Rx(0.5)), 0), [], [1,2,3]) == [1,2,3]
end
4 changes: 4 additions & 0 deletions lib/YaoBlocks/test/composite/composite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ end
include("put.jl")
end

@testset "test pow" begin
include("power.jl")
end

@testset "test repeated" begin
include("repeated.jl")
end
Expand Down
117 changes: 117 additions & 0 deletions lib/YaoBlocks/test/composite/power.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
using Test, YaoBlocks
using LinearAlgebra

# Multi-qubit circuits to use as Power content
circ2 = chain(2, put(1 => Rx(0.3)), put(2 => Rz(0.7)), cnot(2, 1, 2))
circ3 = chain(3, put(1 => H), kron(3, 1 => Rx(0.2), 2 => Ry(0.4)), put(3 => T))

@testset "Power" begin
pb = X ^ 3
@test pb isa Power
@test pb == Power(X, 3)

pb = put(2, 1=>X)^3
println(pb)
@test YaoBlocks.color(Power) == :yellow
pb2 = copy(pb)
@test pb2 == pb
pb2 = put(2, 1=>X)^2
@test cache_key(pb) != cache_key(pb2)
@test YaoBlocks.PropertyTrait(pb) == YaoBlocks.PreserveAll()
@test occupied_locs(pb) == (1,)
end

@testset "mat correctness" begin
for (gate, nq_gate) in [(X, 1), (Rx(0.3), 1), (circ2, 2), (circ3, 3)]
for n in -2:3
pb = gate^n
# Use Matrix() to avoid sparse-type issues with ^0
@test Matrix(mat(pb)) ≈ Matrix(mat(gate))^n
@test Matrix(mat(pb')) ≈ Matrix(mat(gate'))^n
@test Matrix(mat(pb')) ≈ Matrix(mat(pb))'
end
end
end

@testset "apply! on random state" begin
for (gate, nq_gate) in [(X, 1), (Rx(0.3), 1), (circ2, 2), (circ3, 3)]
for n in 0:3
pb = gate^n
reg = rand_state(nq_gate)
reg_ref = copy(reg)
for _ in 1:n
apply!(reg_ref, gate)
end
apply!(reg, pb)
@test statevec(reg) ≈ statevec(reg_ref)

# adjoint
reg2 = rand_state(nq_gate)
reg2_ref = copy(reg2)
for _ in 1:n
apply!(reg2_ref, gate')
end
apply!(reg2, pb')
@test statevec(reg2) ≈ statevec(reg2_ref)
end
end
end

@testset "negative powers" begin
# Negative power requires unitary content
@test_throws ArgumentError matblock(rand(ComplexF64, 2, 2))^(-1)

for (gate, nq_gate) in [(X, 1), (Rx(0.3), 1), (circ2, 2), (circ3, 3)]
for n in -3:-1
pb = gate^n
# apply!: should be the same as applying adjoint |n| times
reg = rand_state(nq_gate)
reg_ref = copy(reg)
for _ in 1:abs(n)
apply!(reg_ref, gate')
end
apply!(reg, pb)
@test statevec(reg) ≈ statevec(reg_ref)
# adjoint of a negative-power block
@test Matrix(mat(pb')) ≈ Matrix(mat(pb))'
end
end
end

nq = 4
@testset "inside put block" begin
for (gate, nq_gate) in [(X, 1), (Rx(0.3), 1), (circ2, 2), (circ3, 3)]
locs = Tuple(1:nq_gate)
for n in [0, 1, 2, 3]
pb = gate^n
circuit = put(nq, locs => pb)
reg = rand_state(nq)
reg_ref = copy(reg)
for _ in 1:n
apply!(reg_ref, put(nq, locs => gate))
end
apply!(reg, circuit)
@test statevec(reg) ≈ statevec(reg_ref)
@test Matrix(mat(circuit)) ≈ Matrix(mat(put(nq, locs => gate)))^n
end
end
end

@testset "inside control block" begin
for (gate, nq_gate) in [(X, 1), (Rx(0.3), 1), (circ2, 2)]
ctrl_loc = nq_gate + 1
locs = Tuple(1:nq_gate)
for n in [1, 2, 3]
pb = gate ^ n
nq_circ = nq_gate + 1
circuit = control(nq_circ, ctrl_loc, locs => pb)
reg = rand_state(nq_circ)
reg_ref = copy(reg)
for _ in 1:n
apply!(reg_ref, control(nq_circ, ctrl_loc, locs => gate))
end
apply!(reg, circuit)
@test statevec(reg) ≈ statevec(reg_ref)
end
end
end
1 change: 1 addition & 0 deletions lib/YaoBlocks/test/measure_ops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ end
3 * put(3, 2 => X),
chain(10, put(2 => X), chain(put(4 => Y))),
chain(10, put(2 => X), chain(put(2 => Y))),
put(3, 2 => X)^4,
]
@show op
@test check_eigenbasis(op)
Expand Down
7 changes: 7 additions & 0 deletions lib/YaoBlocks/test/treeutils/address_manipulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ qft(n) = chain(block_B(n, i) for i = 1:n)
)
@test c5 == 2 * put(10, 1 => X) + Daggered(Scale(Val(2), put(10, 4 => X) |> cache))

# power
c6 = map_address(
put(5, 1:2=>kron(X, Y)) ^ 3,
AddressInfo(10, [8, 5, 4, 6, 3]),
)
@test c6 == put(10, [8,5]=>kron(X,Y)) ^ 3

# qft
c = qft(4)
@test mat(subroutine(10, c, (6, 2, 3, 7))) ≈
Expand Down
1 change: 1 addition & 0 deletions lib/YaoBlocks/test/treeutils/dumpload.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ using YaoBlocks: check_dumpload
@test check_dumpload(control(5, (1, -4), 2 => rot(X, 0.5)))
@test check_dumpload(subroutine(5, rot(SWAP, 0.5), (2, 5)))
@test check_dumpload(repeat(5, put(1, 1 => X), (2, 5)))
@test check_dumpload(put(5, 2=>X)^7)
@test check_dumpload(Measure(5))
@test check_dumpload(Measure(5, operator = put(5, 2 => X)))
@test check_dumpload(Measure(5, locs = (3, 1), resetto = bit"01"))
Expand Down
4 changes: 3 additions & 1 deletion lib/YaoBlocks/test/treeutils/optimise.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ end
@test to_basictypes(control(5, 2, 1 => Rx(0.3))) == control(5, 2, 1 => Rx(0.3))
@test to_basictypes(kron(5, 2 => Y, 3 => X)) == chain(put(5, 2 => Y), put(5, 3 => X))

# repeat, measure
# repeat, power, measure
@test to_basictypes(repeat(5, Y, (2, 3))) == chain(put(5, 2 => Y), put(5, 3 => Y))
@test to_basictypes(put(1, 1=>X)^3) == chain(put(1, 1=>X), put(1, 1=>X), put(1, 1=>X))
@test to_basictypes(put(1, 1=>S)^(-2)) == chain(put(1, 1=>S'), put(1, 1=>S'))
@test to_basictypes(Measure(5)) == Measure(5)
@test to_basictypes(Measure(5; locs = (3, 2, 1))) == Measure(5; locs = (3, 2, 1))
@test to_basictypes(Measure(5; operator = repeat(3, X, 1:3), locs = (3, 2, 1))) ==
Expand Down
Loading