Skip to content

Commit

Permalink
commutator slight change
Browse files Browse the repository at this point in the history
  • Loading branch information
apkille committed Jun 15, 2024
1 parent eeb29c9 commit 8484d53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/QSymbolicsBase/basic_ops_homogeneous.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ children(x::SCommutator) = [:commutator, x.op1, x.op2]
commutator(o1::Symbolic{AbstractOperator}, o2::Symbolic{AbstractOperator}) = SCommutator(o1, o2)
Base.show(io::IO, x::SCommutator) = print(io, "[$(x.op1),$(x.op2)]")
basis(x::SCommutator) = basis(x.op1)
expand(x::SCommutator) = x == 0 ? x : SMulOperator([x.op1, x.op2]) - SMulOperator([x.op2, x.op1])
expand(x::SCommutator) = x == 0 ? x : x.op1*x.op2 - x.op2*x.op1

Check warning on line 211 in src/QSymbolicsBase/basic_ops_homogeneous.jl

View check run for this annotation

Codecov / codecov/patch

src/QSymbolicsBase/basic_ops_homogeneous.jl#L210-L211

Added lines #L210 - L211 were not covered by tests

"""Symbolic anticommutator of two operators
Expand Down Expand Up @@ -236,4 +236,4 @@ children(x::SAnticommutator) = [:anticommutator, x.op1, x.op2]
anticommutator(o1::Symbolic{AbstractOperator}, o2::Symbolic{AbstractOperator}) = SAnticommutator(o1, o2)
Base.show(io::IO, x::SAnticommutator) = print(io, "{$(x.op1),$(x.op2)}")
basis(x::SAnticommutator) = basis(x.op1)
expand(x::SAnticommutator) = x == 0 ? x : SMulOperator([x.op1, x.op2]) + SMulOperator([x.op2, x.op1])
expand(x::SAnticommutator) = x == 0 ? x : x.op1*x.op2 + x.op2*x.op1

Check warning on line 239 in src/QSymbolicsBase/basic_ops_homogeneous.jl

View check run for this annotation

Codecov / codecov/patch

src/QSymbolicsBase/basic_ops_homogeneous.jl#L238-L239

Added lines #L238 - L239 were not covered by tests

0 comments on commit 8484d53

Please sign in to comment.