(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



BeginPackage["QuantumGroups`Utilities`IntersectSubspaces`"]


IntersectSubspaces::usage="IntersectSubspaces[n,\!\(\*SubscriptBox[\"\[Beta]\", \"1\"]\),\!\(\*SubscriptBox[\"\[Beta]\", \"2\"]\),...] gives a basis for the intersection of the subspaces of \!\(\*SuperscriptBox[\"A\", 
RowBox[{\"n\", \" \"}]]\)spanned by the \!\(\*SubscriptBox[\"\[Beta]\", \"i\"]\).";


Begin["`Private`"];


IntersectSubspaces[n_,{}]:=IdentityMatrix[n]


IntersectSubspaces[n_,{basis_}]:=basis


IntersectSubspaces[n_,{{},_}]:={}
IntersectSubspaces[n_,{_,{}}]:={}


IntersectSubspaces[n_,{basis1_,basis2_}]:=NullSpace[Join@@(NullSpace/@{basis1,basis2})]


IntersectSubspaces[n_,{basis1_,basis2_,bases__}]:=IntersectSubspaces[n,{basis1,IntersectSubspaces[n,{basis2,bases}]}]


End[];


EndPackage[];
