-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
37 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Test | ||
import StarAlgebras as SA | ||
using MultivariateBases | ||
const MB = MultivariateBases | ||
using DynamicPolynomials | ||
|
||
@testset "FixedBasis" begin | ||
@polyvar x y | ||
x_term = MB.term_element(1, MB.Polynomial{MB.Monomial}(x)) | ||
y_term = MB.term_element(1, MB.Polynomial{MB.Monomial}(y)) | ||
p1 = x_term + im * y_term | ||
p2 = x_term - im * y_term | ||
fixed = MB.FixedBasis([p1, p2]) | ||
@test length(fixed) == 2 | ||
@test fixed[1] ≈ p1 | ||
@test fixed[2] ≈ p2 | ||
@test sprint(show, fixed) == "FixedBasis([$p1, $p2])" | ||
|
||
semi = MB.SemisimpleBasis([ | ||
MB.FixedBasis([p1]), | ||
MB.FixedBasis([p2]), | ||
]) | ||
@test length(semi) == 1 | ||
@test sprint(show, semi) == "Semisimple basis with 2 simple sub-bases:\n FixedBasis([$p1])\n FixedBasis([$p2])" | ||
mult = semi[1] | ||
@test all(mult.polynomials .≈ [p1, p2]) | ||
smult = SA.star(mult) | ||
@test all(smult.polynomials .≈ [p2, p1]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters