Skip to content

Commit

Permalink
more codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
apkille committed Jul 6, 2024
1 parent 3e9f5e7 commit e9c4c91
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/QSymbolicsBase/predefined.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ const CPHASE = CPHASEGate()

abstract type AbstractSingleBosonOp <: Symbolic{AbstractOperator} end
abstract type AbstractSingleBosonGate <: AbstractSingleBosonOp end # TODO maybe an IsUnitaryTrait is a better choice
isexpr(::AbstractSingleBosonOp) = false
isexpr(::AbstractSingleBosonGate) = false
basis(::AbstractSingleBosonGate) = inf_fock_basis

@withmetadata struct NumberOp <: AbstractSingleBosonOp end
Expand Down
2 changes: 0 additions & 2 deletions src/QSymbolicsBase/rules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ RULES_EXPAND = [
@rule(+(~~ops) * ~o1 => +(map(op -> op * ~o1, ~~ops)...)),
@rule((~~ops1::_vecisa(Symbolic{AbstractBra})) * (~~ops2::_vecisa(Symbolic{AbstractKet})) => *(map(*, ~~ops1, ~~ops2)...)),
@rule((~~ops1::_vecisa(Symbolic{AbstractOperator})) * (~~ops2::_vecisa(Symbolic{AbstractOperator})) => (map(*, ~~ops1, ~~ops2)...)),
@rule(~o1::_isa(Symbolic{AbstractOperator}) * (~~ops) => (map(op -> ~o1 * op, ~~ops)...)),
@rule((~~ops) * ~o1::_isa(Symbolic{AbstractOperator}) => (map(op -> op * ~o1, ~~ops)...)),
]

#
Expand Down
1 change: 1 addition & 0 deletions test/test_trace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ exp2 = A⊗(B⊗C + D⊗E)
@test isequal(ptrace(𝒪, 1), SPartialTrace(𝒪, 1))
@test isequal(ptrace(𝒪, 2), SPartialTrace(𝒪, 2))
@test isequal(ptrace(A, 1), tr(A))
@test isequal(ptrace(A*(B+C), 1), tr(A*B)+tr(A*C))
@test_throws ArgumentError ptrace(A, 2)
@test isequal(QuantumSymbolics.basis(ptrace(𝒪, 1)), SpinBasis(1//2))
@test isequal(QuantumSymbolics.basis(ptrace(𝒪, 2)), SpinBasis(1//2))
Expand Down

0 comments on commit e9c4c91

Please sign in to comment.