Skip to content

Commit

Permalink
Add function isASMMatrix which tests if PASM is ASM.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlaclair committed Nov 1, 2023
1 parent 473856d commit 4ef18a2
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MatrixSchubert.m2
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export{
"isIntersectionSchubIdeals", --documented ++
"isIntersectionOfSchubertDeterminantalIdeals" => "isIntersectionSchubIdeals",
"isASMIdeal", --documented ++
"isASMMatrix", --documented ++
"isASMUnion", --documented ++
"getASM", --documented ++
"isMinRankTable", --documented ++
Expand Down Expand Up @@ -95,6 +96,7 @@ export{
"isCDG", --documented ++
"rajcode", --documented ++
"rajchgotCode" => "rajcode",
"rajCode" => "rajcode",
"rajIndex", --documented ++
"rajchgotIndex" => "rajIndex",
"grothendieckPoly", -- CHECK DOC
Expand Down
19 changes: 19 additions & 0 deletions MatrixSchubert/MatrixSchubertConstructions.m2
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,25 @@ isASMIdeal Ideal := Boolean => (I) -> (
isASM
)


-------------------------------------------
--INPUT: a partial alternating sign matrix
--OUTPUT: whether the matrix is an ASM matrix
--TODO: docs and tests
--TODO: input validation/type checking
-------------------------------------------
isASMMatrix = method()
isASMMatrix Matrix := Boolean => (M) -> (
if not(isPartialASM M) then error("The input must be a partial alternating sign matrix or a permutation.");
n := numrows(M);
m := numcols(M);
if (n != m) then return false;
for i from 0 to n-1 do (
if ((sum entries(M_{i}) != {1}) or (sum entries((transpose M)_{i}) != {1})) then return false;
);
return true
)

-------------------------------------------
--INPUT: a list of permutations in 1 line notation
--OUTPUT: whether the union of their matrix schubert varieties is an ASM variety
Expand Down
21 changes: 21 additions & 0 deletions MatrixSchubert/MatrixSchubertConstructionsDOC.m2
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ doc ///
TO (rankTableFromMatrix, Matrix),
TO (rankTableToASM, Matrix),
TO (isASMIdeal, Ideal),
TO (isASMMatrix, Matrix),
TO (isASMUnion, List),
TO (rotheDiagram, Matrix),
TO (augmentedRotheDiagram, Matrix),
Expand Down Expand Up @@ -994,6 +995,26 @@ doc ///
isASMIdeal I
///

doc ///
Key
isASMMatrix
(isASMMatrix, Matrix)
Headline
whether a matrix is an ASM
Usage
isASMMatrix M
Inputs
M:Matrix
Outputs
:Boolean
Description
Text
Returns true if the given matrix is an ASM, and false otherwise.
Example
M = matrix{{0, 0, 1, 0}, {1, 0, 0, 0}, {0, 1, -1, 1}, {0, 0, 1, 0}}
isASMMatrix M
///

doc ///
Key
isASMUnion
Expand Down
13 changes: 13 additions & 0 deletions MatrixSchubert/MatrixSchubertTests.m2
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,9 @@ assert(isIntersectionSchubIdeals schubDetIdeal I == true );
assert(isASMIdeal schubDetIdeal w == true );
assert(isASMIdeal schubDetIdeal I == true );

--isASMMatrix--
assert(isASMMatrix I == true );

--isASMUnion--
--Examples in other file

Expand Down Expand Up @@ -902,6 +905,16 @@ assert(isASMIdeal schubDetIdeal I == true );
assert(isASMIdeal schubDetIdeal PI == true);
///

TEST ///
--isASMIMatrix--
w = {2,1,6,3,5,4};
I = matrix{{0,0,1,0,0},{0,1,-1,1,0},{1,-1,1,0,0},{0,1,0,-1,1},{0,0,0,1,0}};
PI = matrix{{0,0,1,0,0},{0,1,-1,1,0},{1,-1,1,0,0},{0,1,0,-1,0},{0,0,0,1,0}};

assert(isASMMatrix permToMatrix w == true );
assert(isASMMatrix I == true );
assert(isASMMatrix PI == false);
///

TEST ///
--getASM--
Expand Down

0 comments on commit 4ef18a2

Please sign in to comment.