| Title: | Algebraic Operations and Visualisation for Hl-Rhotrices |
|---|---|
| Description: | Provides constructors for hl-rhotrices of dimension 2, 4 and 6, together with computation of the determinant, adjoint, inverse and eigenvalues under the Robust Multiplication Method (RMM). A 'ggplot2'-based function visualises the rhomboidal layout and the decomposition into principal minors. |
| Authors: | Fabio M. Correa [aut, cre] (ORCID: <https://orcid.org/0000-0002-6708-9316>), Abednego O. Isere [aut], Joseph O. Braimah [aut] |
| Maintainer: | Fabio M. Correa <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.1.0 |
| Built: | 2026-05-21 10:03:06 UTC |
| Source: | https://github.com/cran/hlrhotrix |
Computes the adjoint following Definitions 3.5 and 3.6. Each minor's adjoint is scaled by the product of determinants of all other minors. The sign of the M2 block follows Remark 3.4.
adj_hl(rho)adj_hl(rho)
rho |
An object of class |
An object of class hl_rhotrix representing .
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) adj_hl(A)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) adj_hl(A)
Returns the characteristic polynomial
char_poly_hl(rho)char_poly_hl(rho)
rho |
An object of class |
A named list with elements:
Named vector c(constant, linear, quadratic)
for use with polyroot.
Human-readable string of the polynomial.
Trace of the rhotrix.
Determinant of the rhotrix.
R <- make_R2(a11 = 5, a21 = 3, a12 = 6, a22 = 2) char_poly_hl(R)R <- make_R2(a11 = 5, a21 = 3, a12 = 6, a22 = 2) char_poly_hl(R)
Computes the determinant under the Robust Multiplication Method (RMM)
where the sign of the M2 block is when there is exactly one
M2 minor, and otherwise.
det_hl(rho)det_hl(rho)
rho |
An object of class |
A numeric scalar.
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) det_hl(A) # -36 R <- make_R2(a11=5, a21=3, a12=6, a22=2) det_hl(R) # -8A <- 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) det_hl(A) # -36 R <- make_R2(a11=5, a21=3, a12=6, a22=2) det_hl(R) # -8
Computes the eigenvalues as roots of the characteristic polynomial
eigenvalues_hl(rho)eigenvalues_hl(rho)
rho |
An object of class |
A numeric or complex vector of length 2.
R <- make_R2(a11 = 5, a21 = 3, a12 = 6, a22 = 2) eigenvalues_hl(R) # -8 and 1R <- make_R2(a11 = 5, a21 = 3, a12 = 6, a22 = 2) eigenvalues_hl(R) # -8 and 1
Applies eigenvalues_hl to each principal R2 minor of a
high hl-rhotrix. As noted in the manuscript's concluding remarks, the
computation of eigenvalues for high hl-rhotrices using the basal R2 is
an open research direction.
eigenvalues_hl_high(rho)eigenvalues_hl_high(rho)
rho |
An object of class |
A list; each element is a list with minor (name) and
eigenvalues (length-2 vector) for one R2 minor.
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) eigenvalues_hl_high(A)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) eigenvalues_hl_high(A)
Computes
inv_hl(rho)inv_hl(rho)
rho |
An object of class |
An object of class hl_rhotrix representing .
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) inv_hl(A)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) inv_hl(A)
Constructs the basal hl-rhotrix of dimension 2:
make_R2(a11, a21, a12, a22)make_R2(a11, a21, a12, a22)
a11 |
Top entry (diagonal / vertical axis). |
a21 |
Left entry (symmetric). |
a12 |
Right entry (symmetric). |
a22 |
Bottom entry (diagonal / vertical axis). |
An object of class hl_rhotrix with dim = 2.
Isere (2018). Even Dimensional Rhotrix. Notes on Number Theory and Discrete Mathematics, 24(2), 125-133.
R <- make_R2(a11 = 5, a21 = 3, a12 = 6, a22 = 2) det_hl(R) # -8 eigenvalues_hl(R) # -8 and 1R <- make_R2(a11 = 5, a21 = 3, a12 = 6, a22 = 2) det_hl(R) # -8 eigenvalues_hl(R) # -8 and 1
Constructs a 4-dimensional hl-rhotrix in the rhomboidal layout:
a11
a21 c11 a12
a31 c21 c12 a13
a32 c22 a23
a33
The rhotrix is decomposed into two principal R2 minors (A21, A22) and one M2 minor matrix (M21) following Theorem 3.1.
make_R4(a11, a21, c11, a12, a31, c21, c12, a13, a32, c22, a23, a33)make_R4(a11, a21, c11, a12, a31, c21, c12, a13, a32, c22, a23, a33)
a11, a33
|
Outer diagonal entries. |
a21, a12
|
First-layer symmetric entries. |
c11, c22
|
Inner diagonal entries (second R2 minor). |
a31, a13
|
Second-layer symmetric entries (first R2 minor). |
c21, c12
|
Inner symmetric entries (second R2 minor). |
a32, a23
|
Third-layer symmetric entries (M2 minor). |
An object of class hl_rhotrix with dim = 4.
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 ) det_hl(A) # -36A <- 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 ) det_hl(A) # -36
Constructs a 6-dimensional hl-rhotrix in the rhomboidal layout (see Theorem 3.3 of the manuscript). Decomposed into three principal R2 minors (A21, A22, A23) and three M2 minor matrices (M21, M22, M23).
make_R6( a11, a21, c11, a12, a31, c21, a22, c12, a13, a41, c31, a32, a23, c13, a14, a42, c32, a33, c23, a24, a43, c33, a34, a44 )make_R6( a11, a21, c11, a12, a31, c21, a22, c12, a13, a41, c31, a32, a23, c13, a14, a42, c32, a33, c23, a24, a43, c33, a34, a44 )
a11, a44
|
Outermost diagonal entries. |
a21, a12, a41, a14
|
First and fourth layer symmetric entries. |
c11, c33
|
Outer diagonal entries of the second R2 minor. |
a31, a13, a42, a24
|
Second R2 minor symmetric entries. |
c21, c12, c31, c13
|
Outer symmetric entries of the second R2 minor. |
a22, a33
|
Inner diagonal entries of the third R2 minor. |
a32, a23
|
Inner symmetric entries of the third R2 minor. |
c32, c23
|
Inner symmetric entries of the third M2 minor. |
a43, a34
|
Fifth-layer symmetric entries (second M2 minor). |
An object of class hl_rhotrix with dim = 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 ) det_hl(R6) # 15360R6 <- 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 ) det_hl(R6) # 15360
Produces a publication-quality ggplot diagram showing the
rhomboidal structure of an hl-rhotrix of dimension 2, 4 or 6.
Nodes and regions are colour-coded by minor membership:
Blue: principal minor rhotrices (R2),
entries on the vertical axis.
Amber: minor matrices (M2), symmetric
off-axis entries.
plot_rhombus_gg( dim, gap = 1, node_r = 0.28, show_labels = TRUE, show_regions = TRUE, show_minor_labels = TRUE, show_legend = TRUE, show_edges = TRUE, title = NULL, subtitle = NULL, base_size = 11 )plot_rhombus_gg( dim, gap = 1, node_r = 0.28, show_labels = TRUE, show_regions = TRUE, show_minor_labels = TRUE, show_legend = TRUE, show_edges = TRUE, title = NULL, subtitle = NULL, base_size = 11 )
dim |
Integer. Dimension of the hl-rhotrix: |
gap |
Numeric. Spacing between node centres (default |
node_r |
Numeric. Radius of each node circle (default |
show_labels |
Logical. Display entry labels inside nodes using
plotmath subscript notation (default |
show_regions |
Logical. Draw dashed bounding rectangles around
each minor (default |
show_minor_labels |
Logical. Label each minor region with its
name (default |
show_legend |
Logical. Display the colour legend below the
diagram (default |
show_edges |
Logical. Draw connector lines between nodes of the
same minor (default |
title |
Character. Plot title. |
subtitle |
Character. Plot subtitle. |
base_size |
Numeric. Base font size (default |
The function returns a standard ggplot object. Use
ggplot2::ggsave() to export to PDF, PNG, SVG or EPS.
A ggplot object.
library(ggplot2) # Dimension 2 plot_rhombus_gg(2) # Dimension 4 with title p <- plot_rhombus_gg(4, title = "4-dimensional hl-rhotrix", subtitle = "R2 minors (blue) and M2 matrices (amber)") print(p) # Dimension 6 plot_rhombus_gg(6, gap = 1.1, node_r = 0.26) # Three-panel figure using patchwork library(patchwork) plot_rhombus_gg(2) + plot_rhombus_gg(4) + plot_rhombus_gg(6)library(ggplot2) # Dimension 2 plot_rhombus_gg(2) # Dimension 4 with title p <- plot_rhombus_gg(4, title = "4-dimensional hl-rhotrix", subtitle = "R2 minors (blue) and M2 matrices (amber)") print(p) # Dimension 6 plot_rhombus_gg(6, gap = 1.1, node_r = 0.26) # Three-panel figure using patchwork library(patchwork) plot_rhombus_gg(2) + plot_rhombus_gg(4) + plot_rhombus_gg(6)
Print method for hl_rhotrix
## S3 method for class 'hl_rhotrix' print(x, digits = 4, ...)## S3 method for class 'hl_rhotrix' print(x, digits = 4, ...)
x |
An object of class |
digits |
Number of significant digits (default 4). |
... |
Ignored. |
Invisibly returns x.
Prints the hl-rhotrix structure together with its determinant, adjoint, inverse and eigenvalues.
summary_hl(rho)summary_hl(rho)
rho |
An object of class |
Invisibly returns a list with det, adj, inv
and eigenvalues.
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) summary_hl(A)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) summary_hl(A)
The trace is the sum of entries along the vertical axis
(i.e., ).
trace_hl(rho)trace_hl(rho)
rho |
An object of class |
A numeric scalar.
R <- make_R2(a11 = 5, a21 = 3, a12 = 6, a22 = 2) trace_hl(R) # 7R <- make_R2(a11 = 5, a21 = 3, a12 = 6, a22 = 2) trace_hl(R) # 7