# Introduction to hlrhotrix

## What is an hl-rhotrix?

An hl-rhotrix (heartless rhotrix, or even-dimensional rhotrix) is a mathematical structure introduced by Isere (2018) as a rhotrix from which the central heart entry has been removed. Unlike classical (odd-dimensional) rhotrices, hl-rhotrices have even cardinality and a rich symmetric structure.

The basal hl-rhotrix of dimension 2 has the rhomboidal form:

        a11
      a21  a12
        a22

where `a11`, `a22` lie on the vertical axis (diagonal) and `a21`, `a12` are symmetric entries.

All operations follow the Robust Multiplication Method (RMM) of Isere & Utoyo (2025).

## Creating hl-rhotrices

### Dimension 2

    R <- make_R2(a11 = 5, a21 = 3, a12 = 6, a22 = 2)
    print(R)
    #>
    #> === hl-Rhotrix (dim = 2) ===
    #>
    #> Principal Minor Rhotrices (R2):
    #>   A1: diag = [5, 2],  sym = [3, 6]

### Dimension 4

The 4-dimensional hl-rhotrix decomposes into two R2 principal minors (A21, A22) and one M2 minor matrix (M21) — see Theorem 3.1.

    # Example 3.2 of the manuscript
    A <- make_R4(
      a11 = -2,
      a21 =  3, c11 = 4,  a12 = 1,
      a31 =  1, c21 = 2,  c12 = -1, a13 = 0,
      a32 =  1, c22 = 1,  a23 = 0,
      a33 =  3
    )
    print(A)
    #>
    #> === hl-Rhotrix (dim = 4) ===
    #>
    #> Principal Minor Rhotrices (R2):
    #>   A1: diag = [-2, 3],  sym = [1, 0]
    #>   A2: diag = [4, 1],  sym = [2, -1]
    #>
    #> Minor Matrices (M2):
    #>   M1: [[3, 1], [1, 0]]

### Dimension 6

    R6 <- make_R6(
      a11=1, a21=2, c11=3, a12=4,
      a31=5, c21=6, a22=7, c12=8, a13=9,
      a41=2, c31=3, a32=4, a23=5, c13=6, a14=7,
      a42=1, c32=2, a33=3, c23=4, a24=5,
      a43=6, c33=7, a34=8, a44=9
    )
    print(R6)
    #>
    #> === hl-Rhotrix (dim = 6) ===
    #>
    #> Principal Minor Rhotrices (R2):
    #>   A1: diag = [1, 9],  sym = [2, 7]
    #>   A2: diag = [3, 7],  sym = [3, 6]
    #>   A3: diag = [7, 3],  sym = [4, 5]
    #>
    #> Minor Matrices (M2):
    #>   M1: [[5, 9], [1, 5]]
    #>   M2: [[2, 4], [6, 8]]
    #>   M3: [[6, 8], [2, 4]]

## Determinant

The determinant decomposes as (Definition 3.3):

\[\det(R_n) = \det\!\Bigl(\prod_k A_{2k}\Bigr) \otimes \det\!\Bigl(\prod_l M_{2l}\Bigr)\]

The sign of the M2 block is \(-1\) when there is exactly one M2 minor, \(+1\) otherwise (Definition 3.4).

    det_hl(R)    # -8   (Example 3.3)
    #> [1] -8

    det_hl(A)    # -36  (Example 3.2)
    #> [1] -36

    det_hl(R6)   # 15360
    #> [1] 15360

Theorem 3.4: swapping all symmetric entries negates the determinant.

    B <- make_R4(
      a11=-2, a21=1, c11=4, a12=3,
      a31=0, c21=-1, c12=2, a13=1,
      a32=0, c22=1, a23=1, a33=3
    )
    det_hl(B) == -det_hl(A)
    #> [1] TRUE

## Adjoint

    adj_hl(R)
    #>
    #> === hl-Rhotrix (dim = 2) ===
    #>
    #> Principal Minor Rhotrices (R2):
    #>   A1: diag = [2, 5],  sym = [-3, -6]

    adj_hl(A)
    #>
    #> === hl-Rhotrix (dim = 4) ===
    #>
    #> Principal Minor Rhotrices (R2):
    #>   A1: diag = [18, -12],  sym = [-6, 0]
    #>   A2: diag = [-6, -24],  sym = [12, -6]
    #>
    #> Minor Matrices (M2):
    #>   M1: [[0, 36], [36, 108]]

## Inverse

    inv_hl(R)
    #>
    #> === hl-Rhotrix (dim = 2) ===
    #>
    #> Principal Minor Rhotrices (R2):
    #>   A1: diag = [-0.25, -0.625],  sym = [0.375, 0.75]

    inv_hl(A)
    #>
    #> === hl-Rhotrix (dim = 4) ===
    #>
    #> Principal Minor Rhotrices (R2):
    #>   A1: diag = [-0.5, 0.3333],  sym = [0.1667, 0]
    #>   A2: diag = [0.1667, 0.6667],  sym = [-0.3333, 0.1667]
    #>
    #> Minor Matrices (M2):
    #>   M1: [[0, -1], [-1, -3]]

Verify \(A \cdot A^{-1} = I\) on each R2 block:

    Ai <- inv_hl(A)
    for (k in seq_along(A$A)) {
      Ak <- matrix(c(A$A[[k]]["diag","col1"], A$A[[k]]["sym","col1"],
                     A$A[[k]]["sym","col2"],  A$A[[k]]["diag","col2"]), nrow=2)
      Ik <- matrix(c(Ai$A[[k]]["diag","col1"], Ai$A[[k]]["sym","col1"],
                     Ai$A[[k]]["sym","col2"],  Ai$A[[k]]["diag","col2"]), nrow=2)
      cat(sprintf("Block A%d * inv(A)%d:\n", k, k))
      print(round(Ak %*% Ik, 8))
    }
    #> Block A1 * inv(A)1:
    #>      [,1] [,2]
    #> [1,]    1    0
    #> [2,]    0    1
    #> Block A2 * inv(A)2:
    #>      [,1] [,2]
    #> [1,]    1    0
    #> [2,]    0    1

## Eigenvalues

For a 2-dimensional hl-rhotrix, the characteristic polynomial is \(\Delta(t) = t^2 + \mathrm{tr}(A)\,t + \det(A)\) (Definition 3.8).

    # Example 3.3
    trace_hl(R)          # 7
    #> [1] 7

    char_poly_hl(R)      # t^2 + 7t - 8
    #> $coefficients
    #>  constant    linear quadratic
    #>        -8         7         1
    #>
    #> $poly_string
    #> [1] "t^2 + (7)*t + (-8)"
    #>
    #> $trace
    #> [1] 7
    #>
    #> $determinant
    #> [1] -8

    eigenvalues_hl(R)    # -8 and 1
    #> [1]  1 -8

For higher dimensions, eigenvalues are computed per principal R2 minor:

    eigenvalues_hl_high(A)
    #> [[1]]
    #> [[1]]$minor
    #> [1] "A21"
    #>
    #> [[1]]$eigenvalues
    #> [1]  2 -3
    #>
    #>
    #> [[2]]
    #> [[2]]$minor
    #> [1] "A22"
    #>
    #> [[2]]$eigenvalues
    #> [1] -2 -3

    eigenvalues_hl_high(R6)
    #> [[1]]
    #> [[1]]$minor
    #> [1] "A21"
    #>
    #> [[1]]$eigenvalues
    #> [1]   0.4772256 -10.4772256
    #>
    #>
    #> [[2]]
    #> [[2]]$minor
    #> [1] "A22"
    #>
    #> [[2]]$eigenvalues
    #> [1] -0.3095842 -9.6904158
    #>
    #>
    #> [[3]]
    #> [[3]]$minor
    #> [1] "A23"
    #>
    #> [[3]]$eigenvalues
    #> [1] -0.1010205 -9.8989795

## Full summary

    summary_hl(R)
    #> ==============================================================
    #>   hl-Rhotrix Summary  (dim = 2)
    #> ==============================================================
    #>
    #> === hl-Rhotrix (dim = 2) ===
    #>
    #> Principal Minor Rhotrices (R2):
    #>   A1: diag = [5, 2],  sym = [3, 6]
    #>
    #> Determinant:  -8
    #>
    #> Adjoint:
    #>
    #> === hl-Rhotrix (dim = 2) ===
    #>
    #> Principal Minor Rhotrices (R2):
    #>   A1: diag = [2, 5],  sym = [-3, -6]
    #>
    #> Inverse:
    #>
    #> === hl-Rhotrix (dim = 2) ===
    #>
    #> Principal Minor Rhotrices (R2):
    #>   A1: diag = [-0.25, -0.625],  sym = [0.375, 0.75]
    #>
    #> Trace:               7
    #> Characteristic poly: t^2 + (7)*t + (-8)
    #> Eigenvalues:         lambda1 = 1,  lambda2 = -8
    #>
    #> ==============================================================

## Rhomboidal layout (ggplot2)

`plot_rhombus_gg()` returns a `ggplot` object showing the rhomboidal structure. Blue nodes/regions are principal R2 minors; amber nodes/regions are M2 minor matrices.

    plot_rhombus_gg(2, title = "hl-Rhotrix  (dim = 2)")
    #> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
    #> ℹ Please use `linewidth` instead.
    #> ℹ The deprecated feature was likely used in the hlrhotrix package.
    #>   Please report the issue to the authors.
    #> This warning is displayed once per session.
    #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
    #> generated.

    plot_rhombus_gg(4,
      title    = "hl-Rhotrix  (dim = 4)",
      subtitle = "Minors A21, A22 (R2) and M21 (M2)")

    plot_rhombus_gg(6,
      title    = "hl-Rhotrix  (dim = 6)",
      subtitle = "Minors A21, A22, A23 (R2) and M21, M22, M23 (M2)")

The returned object integrates naturally with the ggplot2 ecosystem:

    # Export for the manuscript (PDF, 300 dpi)
    ggsave("fig_rhombus_dim4.pdf", plot_rhombus_gg(4),
           width = 10, height = 10, units = "cm", dpi = 300)

    # Three-panel figure with patchwork
    library(patchwork)
    plot_rhombus_gg(2) + plot_rhombus_gg(4) + plot_rhombus_gg(6)

    # Further customisation
    plot_rhombus_gg(4) +
      theme(plot.background = element_rect(fill = "grey98", colour = NA))

## References

- Isere, A.O. (2018). Even Dimensional Rhotrix. Notes on Number Theory and Discrete Mathematics, 24(2), 125–133.
- Isere, A.O. & Utoyo, T.O. (2025). On robust multiplication method for higher even-dimensional rhotrices. Notes on Number Theory and Discrete Mathematics, 31(2), 340–360.
- Isere, A.O., Braimah, J.O. & Correa, F.M. (2025). Algebraic Analysis of hl-Rhotrix Operations and Invariants. (submitted)