Abstract
In this paper, we generalize and study the concept of Hadamard product of ideals of projective varieties to the case of monomial ideals. We have a research direction similar to the one of the join of monomial ideals contained in a paper of Sturmfels and Sullivant. In the second part of the paper, we give a brief tutorial on the Hadamard.m2 package of Macaulay2.
MSC:
13F20; 13D02; 13C40; 14N20; 14M99
1. Introduction
The Hadamard product is a sort of multiplication of matrices and in spite of the usual product, it is commutative. This product of matrices is a classical topic in linear algebra that is useful in statistics and physics and it is also studied and used in combinatorial and probabilistic problems. Its applications can be found not only in mathematics but also, for instance, in cryptography, information theory, and data compression such as jpeg format.
Around 2010, in [1,2], the Hadamard product of matrices was extended to the Hadamard product of varieties in the study of the geometry of binary Boltzmann machine. The Hadamard product of varieties is also related to tropical geometry [3,4,5].
Successively, in the last few years, the Hadamard product of projective varieties has been widely studied from the point of view of projective geometry and tropical geometry.
The paper [3], where Hadamard products of general linear spaces are studied, can be considered the first step in this direction, while other papers, for example, Refs. [6,7,8,9,10,11], study the Hadamard product of varieties in relation with star configurations, Hilbert functions, apolarity, and so on.
The computation of the Hadamard product of two varieties X and Y can be conducted in terms of suitable projections of Segre Embedding (Definitions 1 and 2) or working with the ideals of X and Y and using Elimination Theory (Definition 3). This second approach has two main benefits: first, we can use Computer Algebra software, such as Macaulay2 [12], to produce explicit computations and examples; secondly, we can generalize the Hadamard product to any kind of ideal, that is, to ideals which are not associated with varieties (for example, monomial ideals, edge ideals, clutter ideals).
This second fact led us to study carefully the behavior of the Hadamard product of monomial ideals. In Proposition 1, we prove that the Hadamard product of square-free monomial ideals is square-free. The class of square-free monomial ideals is a classical object in commutative algebra, which has a strong connection with combinatorial structures and invariants of hypergraphs. We address our research in the spirit of the paper [13], where another operation between ideals, the so-called join (Definition 4), is taken into consideration and the join of monomial ideals is studied. Moving as in [13], but using the Hadamard product instead of the join, we discover that the Hadamard product of two monomial ideals is nothing more than their sum (Theorem 1), a much easier behavior with respect to the join.
Coming back to the first benefit of the algebraic approach, that is, the use of computer algebra software, it is clear that writing down all the instructions for the computation of the Hadamard product of two ideals is not so difficult, but requires some time. For this reason, the first author created the Hadamard.m2 package of Macaulay2 which has been verified for Macaulay2 development and it can be found at https://github.com/imanbj/Hadamard-m2 (accessed on 1 September 2021). The second part of this paper is intended to be a tutorial that provides a brief introduction to the use of Hadamard.m2 for the Hadamard product of varieties.
2. Preliminaries
We work over an algebraically closed field . We start defining the Hadamard product of projective varieties in two different ways.
Definition 1
([3]). Given varieties , we consider the usual Segre product
and we denote with the coordinates in . Let be the projection map from the linear space Λ defined by equations . The Hadamard product of X and Y is
where the closure is taken in the Zariski topology.
Definition 2
([2]). Let be two points of coordinates and , respectively. If for some i, their Hadamard product of p and q, is defined as
If for all then we say is not defined.
We have that
Hence, Definition 1 of the Hadamard product corresponds to Definition 2.
Remark 1.
We have that
Note that the closure of the map π is necessary unless it is defined on all of , see ([3], Remark 2.4) and Example 5.
We pass on now to defining the Hadamard product using Elimination Theory.
Let be a polynomial ring over an algebraically closed field.
Let be ideals in S. We introduce new unknowns, grouped in r vectors , and we consider the polynomial ring in all variables.
Let be the image of the ideal in under the map .
Definition 3.
Given ideals , their Hadamard product is the elimination ideal
Thus, the defining ideal of the Hadamard product of two varieties X and Y, that is, the ideal , equals the Hadamard product of the ideals (see ([3], Remark 2.6)).
According to [13], we give the following.
Definition 4.
Given ideals , their join is the elimination ideal
We define the r-th secant of an ideal to be the r-fold join I with itself:
Similarly, we define the r-th Hadamard power of an ideal to be the r-fold Hadamard product of I with itself:
3. Hadamard Products of Monomial Ideals
We start with a preliminary more general result.
Lemma 1.
The Hadamard product distributes over intersections:
Proof.
The proof is analogous to ([14], Lemma 2.6). A polynomial f belongs to if and only if if and only if for all if and only if . □
Example 1.
Let and consider the ideals and If ; then, . The proof follows from the definition.
Definition 5.
An ideal is a monomial ideal if it is generated by monomials. A monomial ideal I is a square-free monomial ideal if it is generated by monomials of the form with .
A special family of monomial ideals is the class of irreducible monomial ideals. An irreducible monomial ideal is represented by an integer vector as follows:
Example 1 generalizes to irreducible monomial ideals in variables.
Lemma 2.
The Hadamard product of two irreducible monomial ideals and is an irreducible monomial ideal where
Proof.
A polynomial lies in the monomial ideal if and only if lies in the monomial ideal
This happens if and only if every term lies in (1). Now, lies in if and only if every term of
lies in if and only if for some i with or if and only if lies in . □
The next result shows that the Hadamard product of ideals maintains some property of the starting ideals.
Proposition 1.
Let be monomial ideals in Then is a monomial ideal. If are square-free, then monomial ideal is square-free.
Proof.
It is enough to consider the case since, then, the general statement follows by induction on r. If and are irreducible ideals then both statements follow from Lemma 2. Otherwise, we decompose and as intersections of irreducible monomials ideals. Using Lemma 1, we then write
Thus, is a monomial ideal, and its set of standard monomials is the union of the sets of standard monomials of its irreducible components . Assume that and are square-free. We can decompose and with , as intersections of irreducible linear monomials ideals. Again by Lemma 1, we then write as in (2). Since each is square-free, is square-free. □
We can now prove the main result of this section, showing that the Hadamard product of two monomial ideals is equal to their sum.
Theorem 1.
Let I and J be monomial ideals in . Then .
Proof.
First, assume that the given ideals are irreducible, say, and . Then the result follows by applying Lemma 2. For the general case, we decompose the two given monomial ideals into their irreducible components: and . By Lemma 1 and the result for irreducible ideals, we get
This completes the proof of Theorem 1. □
As a corollary, we get immediately the following result.
Corollary 1.
Let I be a monomial ideal in . Then .
We end this section with a few results about the join and Hadamard product of irreducible monomial ideals, also in connection with the irrelevant ideal .
Proposition 2.
.
Proof.
We decompose and . The proof follows from ([13], Lemma 2.3) and ([14], Lemma 2.6). □
Corollary 2.
If , then .
Proof.
The proof follows from Theorem 1. □
Proposition 3.
Given two irreducible monomial ideals and , one has
Proof.
By Lemma 2.3 in [13], the minimal generators of are of the form when and . For the same values of and , the corresponding generator of is given by . Since the claim easily follows. □
4. Hadamard.m2
We give now some explanations of the commands in Hadamard.m2 together with examples.
Looking at the documentation page, we can note that the package contains:
Types
- ∘
- Point - a new type for points in projective space.
Functions and commands
- ∘
- hadamardPower - computes the Hadamard powers of varieties;
- ∘
- hadamardProduct - computes the Hadamard product of varieties;
- ∘
- idealOfProjectivePoints - computes the ideal of a set of points;
- ∘
- point - constructs a projective point from the list or array of coordinates.
Methods
- ∘
- hadamardPower(Ideal,ZZ) - computes the r-th Hadamard power of varieties;
- ∘
- hadamardPower(List,ZZ) - computes the r-th Hadamard power of a set of points;
- ∘
- hadamardProduct(Ideal,Ideal) - computes the Hadamard product of two homogeneous ideals;
- ∘
- hadamardProduct(List) - computes the Hadamard product of a list of homogeneous ideals or points;
- ∘
- hadamardProduct(List,List) - computes the Hadamard product of two sets of points;
- ∘
- “idealOfProjectivePoints(List,Ring)”- see idealOfProjectivePoints - computes the ideal of a set of points;
- ∘
- “point(VisibleList)”(see point) - constructs a projective point from the list or array of coordinates.
- ∘
- Point * Point - entry-wise product of two projective points;
- ∘
- Point == Point - check equality of two projective points.
In this package, a point can be constructed in two different and equivalent ways: both from a list {} and both from an array []. Hence both the commands p = point {1,2,3} and p = point [1,2,3] define the same point . In the following examples, we use both methods to define points.
Once the package is loaded the Hadamard product of two points is defined by ∗.
Example 2.
Consider the points .
Macaulay2, version 1.21
i1 : loadPackage"Hadamard"
i2 : p = point {1,2,3};
i3 : q = point [-1,2,5];
i4 : p * q
o4 = Point{-1, 4, 15}
i5 : x = point [1,1,2];
i6 : y = point {2,2,4};
i7 : x == y
o7 = true
i8 : p == q
o8 = false
The function hadamardProduct is one of the main functions in Hadamard.m2.
hadamardProduct is multi-functional and works in different ways: it computes the Hadamard products of two ideals, two sets of points, or a list of ideals or points. Hence, according to the aim of computation, hadamardProduct can have a different number of inputs.
Before showing some examples, we mention the mathematical approach inside hadamardProduct.
Let X and Y be two varieties in . Denote by and their corresponding vanishing ideals. We consider
Let . We define the map
Hence, we have that .
Example 3.
Consider the ideals I and J.
i9 : S = QQ[x,y,z,w];
i10 : I = ideal(x-y+z,z+y+w);
i11 : J = ideal(2∗x-y,w+x+y+z);
i12 : hadamardProduct(I,J)
o12 = ideal(6x^2 - 9x∗y + 3y^2 - 2x∗z + 2y∗z + 2x∗w - y∗w)
Example 4.
Using idealOfProjectivePoints, one can compute the vanishing ideal of a list of points. Here, we use two different methods to compute the Hadamard product of two points. First, we use ∗ and then idealOfProjectivePoints.
i13 : p = point {1,-1,4,2};
i14 : q = point {1,2,0,-1};
i15 : idealOfProjectivePoints({p∗q},S)
o15 = ideal (z, y - w, 2x + w)
Now, we first use idealOfProjectivePoints to compute the defining ideals of the points; then, we apply hadamardProduct.
i23 : Ip = idealOfProjectivePoints({p},S)
o23 = ideal (z - 2w, 2y + w, 2x - w)
i24 : Iq = idealOfProjectivePoints({q},S)
o24 = ideal (z, y + 2w, x + w)
i25 : hadamardProduct(Ip,Iq)
o25 = ideal (z, y - w, 2x + w)
i26 : o25 == o15
o26 = true
Example 5.
Due to Remark 1, consider the curve defined by and the point . The Hadamard product is the line . However, the point cannot be obtained as with .
i27 : T = QQ[x,y,z];
i28 : IX = ideal(x*y-z^2)
i29 : p = point[1, 0, 2]
i30 : Ip = idealOfProjectivePoints({p},T)
o30 = ideal (y, 2x - z)
i31 : hadamardProduct(Ip,IX)
o31 = ideal y
Given two sets of points L and M, hadamardProduct returns the list of (well-defined) entry-wise multiplications of pairs of points in the Cartesian product .
Example 6.
Consider the two sets of points L and M.
i32 : L = point\{{0,1}, {1,2}};
i33 : M = point\{{1,0}, {2,2}};
i34 : hadamardProduct(L,M)
o34 = {Point{1, 0}, Point{0, 2}, Point{2, 4}}
Note that the map π is not defined on all since point{0,1} ∗ point{1,0} = point{0,0}.
The Hadamard products of a list of ideals or points are constructed by using the binary function hadamardProduct(Ideal,Ideal), or Point ∗ Point iteratively. So, in this case, hadamardProduct requires in input only one argument given by the list, as shown in the following example.
Example 7.
Consider again the ideals I and J of Example 3 and let K be an ideal different from I and J.
i35 : K = ideal(2∗x-y,w+x+y+z, z-w)
o35 = ideal (2x - y, x + y + z + w, z - w)
i36 : L = {I,J,K};
i37 : hadamardProduct(L)
o37 = ideal(72x^2 - 54x*y + 9y^2 + 16x*z - 8y*z - 16x*w + 4y*w)
i38 : P = point\{{1,2,3},{-1,1,1},{1,1/2,-1/3}};
i39 : hadamardProduct(P)
o39 = Point{-1, 1, -1}
For any projective variety X, we defined, in Section 2, its Hadamard square and its higher Hadamard powers .
Give a homogeneous ideal I or a set of points L, the r-th Hadamard power of I or L is computed via the function hadamardPower. The function computes the r-times Hadamard products of I or L to itself.
Example 8.
Consider the ideals I and K of Examples 3 and 7.
i40 : hadamardPower(J,3)
o40 = ideal(8x - y)
i41 : hadamardPower(K,3)
o41 = ideal (z - w, 27y + 64w, 27x + 8w)
i42 : L = {point{1,1,1/2},point{1,0,1},point{1,2,4}};
i43 : hadamardPower(L,2)
o43 = {Point{1, 0, 1}, Point{1, 0, 1/2}, Point{1, 0, 4},
Point{1, 4, 16}, Point{1, 2, 2}, Point{1, 1, 1/4}}
Example 9.
Here is another example of Hadamard power.
i44 : S = QQ[x,y,z];
i45 : X = point\ {{1,1,0},{0,1,1},{1,2,-1}};
i46 : A = idealOfProjectivePoints(X,S)
o46 = ideal(3x∗z - y∗z + z^2, 3x∗y - 3y^2 - y∗z + 4z^2,
3x^2 - 3y^2 - 2y∗z + 5z^2, y^2z + y∗z^2 - 2z^3)
i47 : A2 = hadamardPower(A,2)
o47 : ideal(y^2∗z - 18x∗z^2+ y∗z^2 - 2z, x∗y∗z - 4x∗z^2,
x^2∗z - x∗z^2, 2x^3 - 3x^2∗y + x∗y^2 - 6x∗z^2)
i48 : X2 = hadamardPower(X,2);
i49 : A2 == idealOfProjectivePoints(X2,S)
o49 = true
Theorem 2
([5]). Let L and M be two lines in . Then is a quadratic form.
Example 10
(Example 6.1 in [3]). Let L be the line in through points and and M the line through and Let be the homogeneous coordinates of . We compute as follows:
i50 : S = QQ[x,y,z,w];
i51 : L = matrix{{2, 3, 5, 7},{11, 13, 17, 19}};
i52 : IL = ideal flatten entries(matrix{gens S} ∗ gens ker L);
i53 : M = matrix {{23, 29, 31, 37},{41, 43, 47, 53}};
i54 : IM = ideal flatten entries(matrix{gens S} ∗ gens ker M);
i55 : hadamardProduct(IL,IM)
o55 = ideal(88128x^2 - 89280x∗y - 5299632y^2 - 817938x∗z + 8896641y∗z -
1481805z^2 - 321510x∗w - 1777545y∗w - 54250z∗w + 116375w^2)
Example 11.
Let and be two monomial ideals. By Theorem 1, we know that the Hadamard product is equal to .
i56 : M1 = ideal(x∗y,x∗z,w);
i57 : M2 = ideal(y^2,x∗w,x^2∗y);
i58 : hadamardProduct(M1,M2)
o58 = ideal(w, x∗z, y^2 , x∗y)
i59 : M1+M2
o59 = ideal(x∗y, x∗z, w, y^2 , x∗w, x^2y)
i60 : o58 == o59
o60 = true
i61 : trim o59
o61 = ideal(w, x∗z, y^2 , x∗y)
Since coordinate hyperplanes are defined by monomial ideals (with only one variable), Theorem 1 gives another proof of part of the following Lemma.
Lemma 3
(Lemma 4.1 in [15]). Let be any coordinate hyperplane, for . Then,
- (i)
- is the linear subspace .
- (ii)
- for any hypersurface C different from a coordinate hyperplane.
Example 12.
Let and be two lines in . One can see that the Hadamard product is the point obtained by the intersection of and . We have that .
i62 : S = QQ[x,y,z];
i63 : IL1 = ideal(x);
i64 : IL2 = ideal(y);
i65 : hadamardProduct(IL1,IL2)
o65 = ideal(y,x)
i66 : IL1+IL2
o66 = ideal(y,x)
Author Contributions
Software, I.B.J., C.B. and E.G.; Writing—original draft, I.B.J., C.B. and E.G.; Writing—review & editing, I.B.J., C.B. and E.G. All authors have read and agreed to the published version of the manuscript.
Funding
I. Bahmani Jafarloo’s work has been supported by Università degli Studi di Catania, grant “Hadamard product and symbolic powers”, D.R. n. 3158, 17 September 2021, “Progetto Piaceri, Linea di intervento 2”, E. Guardo’s work has been supported by the Università degli Studi di Catania, “Progetto Piaceri, Linea di intervento 2”. C. Bocci and E. Guardo have been supported by the project “0-dimensional schemes, Tensor Theory and Applications”—PRIN 2022—Finanziato dall’Unione europea—Next Generation EU—CUP: E53D23005670006.
Data Availability Statement
Data are contained within the article.
Acknowledgments
I. Bahmani Jafarloo thanks C. Bocci for their hospitality and for providing scientific discussion during his staying in Siena. C. Bocci and E. Guardo are members of GNSAGA of INDAM (Italy).
Conflicts of Interest
Iman Bahmani Jafarloo was employed by Evolution. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest. Evolution had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.
References
- Cueto, M.A.; Morton, J.; Sturmfels, B. Geometry of the restricted Boltzmann machine. In Algebraic Methods in Statistics and Probability; Contemporary Mathematics; Viana, M., Wynn, H., Eds.; American Mathematicals Society: Providence, RI, USA, 2010; Volume 516, pp. 135–153. [Google Scholar]
- Cueto, M.A.; Tobis, E.A.; Yu, J. An implicitization challenge for binary factor analysis. J. Symb. Comput. 2010, 45, 1296–1315. [Google Scholar] [CrossRef] [Scilit]
- Bocci, C.; Carlini, E.; Kileel, J. Hadamard products of linear spaces. J. Algebra 2016, 448, 595–617. [Google Scholar] [CrossRef] [Scilit]
- Friedenberg, N.; Oneto, A.; Williams, R.L. Minkowski sums and Hadamard product of algebraic vatieties. In Combinatorial Algebraic Geometry; Fields Institute Communications; Smith, G., Sturmfels, B., Eds.; Springer: New York, NY, USA, 2017; Volume 80, pp. 133–157. [Google Scholar]
- Maclagan, D.; Sturmfels, B. Introduction to Tropical Geometry; Graduate Studies in Mathematics; American Mathematicals Society: Providence, RI, USA, 2015; p. 161. [Google Scholar]
- Jafarloo, I.B.; Bocci, C.; Guardo, E.; Malara, G. Hadamard products of symbolic powers and Hadamard fat grids. Mediterr. J. Math. 2023, 20, 162. [Google Scholar] [CrossRef] [Scilit]
- Jafarloo, I.B.; Calussi, G. Weak Hadamard star configuration and Apolarity. Rocky Mt. J. Math. 2020, 50, 851–862. [Google Scholar]
- Bocci, C.; Calussi, G.; Fatabbi, G.; Lorenzini, A. On Hadamard products of linear varieties. J. Algebra Appl. 2017, 16, 1750155. [Google Scholar] [CrossRef] [Scilit]
- Bocci, C.; Calussi, G.; Fatabbi, G.; Lorenzini, A. The Hilbert function of some Hadamard products. Collect. Math. 2018, 69. [Google Scholar] [CrossRef] [Scilit]
- Calussi, G.; Carlini, E.; Fatabbi, G.; Lorenzini, A. On the Hadamard products of degenerate subvarieties. Port. Math. 2019, 76. [Google Scholar] [CrossRef] [Scilit]
- Carlini, E.; Catalisano, M.V.; Guardo, E.; Van Tuyl, A. Hadamard star configurations. Rocky Mt. J. Math. 2019, 49, 419–432. [Google Scholar] [CrossRef] [Scilit]
- Grayson, D.R.; Stillman, M.E. Macaulay2, a Software System for Research in Algebraic Geometry. The Current Stable Version is 1.23, Released 20 March 2024. Available online: https://www.macaulay2.com/ (accessed on 20 March 2024).
- Sturmfels, B.; Sullivant, S. Combinatorial Secant Varieties. Pure Appl. Math. Q. 2006, 2, 867–891. [Google Scholar] [CrossRef] [Scilit]
- Sullivant, S. Combinatorial symbolic powers. J. Algebra 2008, 319, 115–142. [Google Scholar] [CrossRef] [Scilit]
- Bocci, C.; Carlini, E. Hadamard products of hypersurfaces. J. Pure Appl. Algebra 2022, 226, 107078. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).