{'fraction_non_alphanumeric': 0.05370379708537139, 'fraction_numerical': 0.014068882053350815, 'mean_word_length': 4.239630118890356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Unitary rotation of pixellated polychromatic images

Unitary rotations of polychromatic images on finite two-dimensional pixellated screens provide invertibility, group composition, and thus conservation of information. Rotations have been applied on monochromatic image data sets, where we now examine closer the Gibbs-like oscillations that appear due to discrete"discontinuities"of the input images under unitary transformations. Extended to three-color images we examine here the display of color at the pixels where, due to the oscillations, some pixel color values may fall outside their required common numerical range [0, 1], between absence and saturation of the red, green, and blue formant color images.


Introduction
In geometric and in wave optics, transformations that respect the Hamiltonian structure of the models are called canonical; they are termed linear when the phase space coordinates are linearly mapped. Images displayed on screens can undergo linear maps representing free propagation, rotation, gyration, squeezing, fractional Fourier and other transformations for one-or two-dimensional images on line or plane screens.
The discrete version of these systems and transformations, are based on the finite oscillator model [1,2,3], which considers finite pixellated line or plane screens that bear the set of generally complex data values that form the image. The requirement that the transformations be unitary to conserve Hilbert space properties of the image data sets (orthogonality, reality), requires them to be elements of a group, of which screen rotations form a one-parameter subgroup, to guarantee invertibility and proper concatenation for two or more such transformations. In particular, when the pixel values are real, they should remain so under rotation.
For this article to be essentially self-contained, in Sect. 2 we remind the reader of the basic finite oscillator model for D = 1 and D = 2-dimensional finite pixellated images along Cartesian coordinates [4]. We emphasize that this rotation algorithm provides the only unitary rotation coefficients for the image pixels on an N x × N y generally rectangular screen [5]. For simplicity we address here only square N × N images and screens.
In this paper we extend unitary rotations to polychromatic pixellated arrays that carry the three component color values (for red, green and blue) as generally used in the applied literature. In the polychromatic case, the ranges of the pixel values are restricted to the common interval [0, 1], between absence and saturation of each color. The main problem that appears now is that of Gibbs-like oscillations in one or more color component images of pixel values that may fall outside that basic [0, 1] range. This must be addressed with an appropriate display tactic, which is laid out in Sect. 3. Finally, in the concluding Sect. 4, we comment further on linear unitary transformations of pixellated data that are required to conserve information and Hamiltonian structure.

Finite one-and two-dimensional images
The finite oscillator model [6] is based on the Lie algebra of spin su(2), with gen- , whose representation multiplets, of dimension N = 2j + 1 (with j a non-negative integer or half-integer), are interpreted to contain its N equidistant eigenstates. The eigenvalues of the generator Q := J 1 characterize the N pixel positions on a screen, P := J 2 is momentum, while those of K := J 3 number the N 'energy' states. The overlap between the position and mode eigenbases yields the finite oscillator wavefunctions. This finite model mimics the usual 'continuous' harmonic oscillator based on the Heisenberg-Weyl algebra (of commutator [Q, P ] = ih1 , where the spectrum of position Q and of momentum P are the full real line), whose energy eigenstates of H := 1 2 (P 2 + Q 2 ) are equally-spaced with only a lower bound.

The one-dimensional finite oscillator and screen
For D = 1-dimensional screens of N pixels in a line, the finite quantization of the harmonic oscillator replaces the commutator [Q, P ] = i1 of the continuous model with [Q, P ] = iK in their N = 2j + 1-dimensional representation [1]. Finite quantization thus assigns N × N su(2) matrix representations Q and P to position and momentum q and p, as follows: P q,q = −i 1 2 (j−q)(j+q+1) δ q+1,q + i 1 2 (j+q)(j−q+1) δ q−1,q , and their commutator : These three operators are thus represented by self-adjoint N × N matrices in the vector space with inner product j q=−j f q g * q , and generate the Lie algebra su(2) with commutation relations where the first two will stand in place of the two Hamiltonian commutators in the continuous model, [H, Q] = −iP and [H, P ] = iQ. The eigenvalue spectra of the three su(2) generators are Σ(Q) = Σ(P ) = Σ(K) = {−j, −j+1, . . . , j} =: | j −j , and we remark that the position operator Q = J 1 , is here diagonal. Finally, the eigenvalues of the mode operator K + j1 will count its eigenstates by the mode number n := κ + j as Σ(K + j1 ) := κ + j = n ∈ {0, 1, . . . , 2j}. (5) Using Dirac notation, let the orthogonal and complete eigenbases of the position and mode operators, J 1 and J 3 , be Q|j, q 1 = q|j, q 1 , q| j −j , K|j, n 3 = κ|j, n 3 = (n−j)|j, n 3 , n| 2j 0 .
One-dimensional finite signals or discrete images F = {F q } j q=−j are then given by N = (2j+1)-dimensional vectors of components The overlap between the two bases in (6) leads to a three-term difference equation that yields the Wigner 'little-d' functions [7] for the angle 1 2 π between the two axes, which are the finite oscillator wavefunctions [1]: Ψ n (q) := 1 j, q|j, n 3 = d j n−j,q ( 1 2 π) = Ψ q+j (n−j) that are given in terms of the square root of a binomial coefficient in q, a discrete version of a Gaussian, and symmetric Kravchuk polynomials of degree n, K n (q+j; 1 2 ; 2j) = K q+j (n; 1 2 ; 2j) = 2 F 1 (−n, −2j−q; −2j; 2), that are discrete analogues of Hermite polynomials. The set of functions {Ψ n (q)} 2j n=0 , and also the set {Ψ n (q)} j q=−j , form orthonormal bases for the N -dimensional space of signals (i.e., one-dimensional pixellated images on linear screens), so j q=−j Ψ n (q)Ψ n (q) = δ n,n and 2j n=0 Ψ n (q)Ψ n (q ) = δ q,q . Finally, we write the general form of the Wigner 'little-d' functions [7,Sect. 3.6], where the summation extends over the integer range max(0, m−m ) ≤ k ≤ min(j−m) for m > m , while for m < m the reflection formula in (8) applies.

Finite two-dimensional images
In D = 2 dimensions, the finite oscillator Lie algebra is su(2) x ⊕ su(2) y = so(4), i.e., the four-dimensional orthogonal Lie algebra, which contains in particular the generator of an SO(2) group of rotations in the x-y plane. (Lie algebras are denoted by lower-case letters, their generated Lie groups by upper-case letters.) On a square screen, the so(4) algebra represents finite images F by N × N matrices of entries {F qx,qy }, where −j ≤ q x , q y ≤ j are integer-spaced. Generic rectangular pixellated screens N x × N y have been considered in [5] with general representations of so (4), but square ones are simpler and suffice for this study. Finite 2D images can be characterized also by a second set of N 2 pixel values that follow polar coordinates responding to the subalgebra chain so(4) ⊃ so(3) ⊃ so(2) [2]. The rotation of pixellated images in a square screen is then accomplished by transforming from the Cartesian to the polar basis, rotating through multiplicative phases in the polar basis, and transforming back to the Cartesian basis.
In two dimensions marked by orthogonal axes x, y, the algebra su(2) x ⊕ su(2) y provides two sets of generators (1)-(3) that mutually commute and provide, as in (6), their common eigenbases with j x = j = j y (where we omit writing j henceforth), defining the N 2 states {|q x , q y 1 } of the position basis and the N 2 states {|n x , n y 3 } of the mode basis. The overlap between these two orthogonal eigenbases provides the 2D finite Cartesian oscillator wavefunctions, Ψ nx,ny (q x , q y ) = 1 q x , q y |n x , n y 3 = Ψ nx (q x ) Ψ ny (q y ).
As before, the set of functions {Ψ nx,ny (q x , q y )} forms orthonormal bases for the N 2dimensional space of pixellated two-dimensional images with respect to the indices q x , q y and with respect to n x , n y . Two-dimensional images F = {F qx,qy } j qx,qy=−j are thus represented by the values of N × N matrices built with the adjoint of the position basis |q x , q y 1 in (10), as was done in (7) for one dimension, Next, according to the commutation relations (4), K x and K y generate independent rotations in the (Q x , P x ) and (Q y , P y ) phase planes. Their sum and difference have the eigenvalue sets There follows the definition of a distinct position-momentum basis [2] that is classified by the so(4) generators With K and M , these operators satisfy the commutation relations that interpret K as the generator of isotropic fractional Fourier-Kravchuk transforms [2,3], and M as the generator of rotations of the phase space operators in (15). The commuting operators K, M define the orthonormal polar eigenbasis {|n, m P }, The overlap between the position basis and the polar basis determines the 2D finite polar oscillator wavefunctions [2], Here also, the set of functions {Λ j n,m (q x , q y )} provide orthonormal bases for the N 2space of images, with respect to the indices q x , q y and with respect to n, m.
By construction, the functions (18) transform under rotations through multiplication by phases, The rotation of finite images R(θ) : |F → |F (θ) from the set {F qx,qy } to {F (θ) qx,qy } can thus proceed as = n,m;q x ,q y 1 q x , q y |n, m P P n, m|R(θ)|n, m P P n, m|q x , q y 1 1 q x , q y |F = n,m;q x ,q y 1 q x , q y |n, m P e −imθ P n, m|q x , q y 11 q x , q y |F with n| 2j 0 , m| 2j −2j and q x , q y | j −j , where the kernel of rotation is given by R(q x , q y ; q x , q y ; θ) := n,m Λ j n,m (q x , q y ) e −imθ Λ j n,m (q x , q y ) * .
When the input image is a matrix of real numbers, after rotation it will remain a real matrix, because the rotation kernel (22) is real. Due to the orthonormality of the bases, from (22) or (23), we see that R(q x , q y ; q x , q y ; 0) = δ qx,q x δ qy,q y is the unit transformation. Similarly, the product of two rotations satisfies group composition q x ,q y R(q x , q y ; q x , q y ; θ 1 )R(q x , q y ; q x , q y ; θ 2 ) = R(q x , q y ; q x , q y ; θ 1 + θ 2 ), and the inverse is R(q x , q y ; q x , q y ; −θ) = R(q x , q y ; q x , q y ; θ) * . This shows that the matrices in the set (22) are unitary, R(−θ) = R(θ) † , and is a representation of the group SO(2) of plane rotations; it is reducible in the polar basis but irreducible in the Cartesian basis. As an example of this rotation algorithm we provide Fig. 1 that we proceed to examine and comment.

The 'Gibbs-like' oscillation phenomenon
As is evident in Fig. 1, a ubiquitous consequence of the unitarity of the rotation algorithm is that rotated images display oscillations due to 'discrete discontinuities', i.e., large differences between values of neighboring pixels. This oscillation pattern reminds us of that appearing in another context: the summation of truncated Fourier series, known as the Gibbs phenomenon. Because their origin is different (i.e., it is not a type of Gibbs oscillation), we shall call these oscillations Gibbs-like; here we address this phenomenon for the first time.
Linear normalization is the main tactic to keep the grey-tone scale within the specified range [0, 1], between absence and saturation of the pixel values. We thus distinguish between the data-image whose pixel values can have any range, and the screen-image which is output for display, where pixel values are all within [0, 1]. This tactic maps the data-to screen-values, F → F, using the extreme values, F qx,qy → F qx,qy = F qx,qy − s N S N − s N , s N := min qx,qy {F qx,qy } < 0, S N := max qx,qy {F qx,qy } > 1. (24) The screen-image will thus have a minimum of complete blacks and whites, with no information loss. Whereas in the familiar trigonometric Gibbs phenomenon, a unit step function Θ(q) := 1 2 (1 + sign q) entails a maximal overshoot of ∼8.95% at a positions ever closer to the discontinuity as the number of series terms grows (see [9,Fig. 4 Whereas clipping leads to a more contrasted image, it also entails loss of information in pixel values; normalization retains information subject to translation and scale, although it appears less contrasted. and a discrete step function along the x-axis for even N = 2j + 1 rows and columns shown for rotations of 1 8 π and 1 4 π in Figs. 2 and 3 respectively. The resulting oscillations are recognizably parallel to the lines of discontinuity. To evince this oscillation behavior we plot below the pixel values along the main anti -diagonal of each screen A first observation is that, unlike the continuous case, the over-and underoscillations are not symmetrical. This is because while in the Gibbs case e 0ix = 1 belongs to the Fourier series terms and allows the addition of constants, in the discrete case Ψ 0,0 (q x , q y ) is not a constant that could be freely added to all pixel values. Most importantly, we note that the over-and under-shoots diminish with increasing N : as the pixellation becomes finer, the finite oscillator states approximate those of continuous systems -as expected. Yet, although the delta and step functions lead to rotated images that are relatively simple to write analytically, they are not very useful to elucidate certain systematic features of their rotated images on the pixellated screen, such as the the behavior on and near the screen vertices and edges, as can be seen in those figures.

Three-color pixellated images
With a qualitative understanding of oscillations due to discrete Kronecker deltas and step functions, we now extend the algorithm from rotations of monochromatic finite N × N pixellated images presented in the previous section, to polychromatic images  within the standard three-color scheme of RGB (Red-Green-Blue) technology. Each channel, R, G or B, is a monochromatic image; polychromatic images (indicated by sans serif font) are the direct sum of the three components where the pixel values for each color are all in the range [0, 1], where X stands for R, G or B, with values 0 for absence and 1 for saturation in each color. Under rotation we let each component undergo the same transformation (20)-(22) detailed in the previous section, The RGB color scheme is an industrial standard [14] that entails an additive colorimetric scale, that is, each of the elements of each channel sums to define an individual color [11,12]. Physically, each of the colors in the RGB scheme is associated with the way the human eye perceives and processes light with the photoreceptor cells in the retina [13]. The chromatic response is intrinsic to the aggregation of the three channels and independent of the luminescence, which means that the white point of the scale is the algebraic sum of the three channel values, and independent of the illumination [21]. This color scheme is strictly positive within a range of bits or bytes displayed in digital or analogue devices [15,16]. Although pixel values outside the standard range have been also used as representing complementary colors [18,17], we forego this alternative interpretation because it would introduce dubious changes in the color rendering of black or white backgrounds.
Here we address the joint display of the three data-image matrices to acceptably transform color images. The normalization of pixel values (24) now requires the extreme values among the three colors to define, for Y ∈ {R, G, B}, s N := min X; qx,qy {F X qx,qy } < 0, S N := max X; qx,qy {F X qx,qy } > 1.
Two examples of this unitary rotation algorithm for three-color images are presented in Figs. 4, for images with high and low pixel discontinuity contrasts. We should remark that the computation of all figure rotations in this report has been performed with an algorithm that enhances the speed of the previously used rotation algorithms [2,5] that needs the computation of the special functions in the kernel (22). Previous reports of unitary transformations did not focus on the computational efficiency because one was more interested in the mathematical features of the transformations. Yet for example in [5] a grayscale rectangular image of 61 × 37 = 2257 pixels was calculated in ∼78 hours, here each of the three layers of Fig. 4 has 52 × 52 = 2704 pixels that were computed in ∼250 seconds, while the full RGB image took ∼12 minutes to complete. This improvement is due to two Figure 4: Left: Two RGB 52 × 52 pixellated images (above a pseudo-Mario, below, the well-known Lena). Center and Right: Their unitary rotation by θ = 1 8 π and 1 4 π with the normalization (29); the data image of the former can be further rotated by 1 8 π to obtain the data-image of the latter, because the unitary transformations satisfy composition. factors: first, the optimization of the routine to calculate the elements in (22) was done through a three-term recurrence relation (instead of library functions), and that a high-level scripting language such as Julia [20] was used, allowing the implementation of a syntactically natural transformation algorithm that simultaneously profits from the multi-threading in modern CPU's. For more technical details, such as the binomial overflow as N grows, the algorithm we used in all the previous figures is provided by an Open Source code shared on a public repository [8], to fulfill the principle of reproducibility for the results here presented.

Conclusions
We remarked above that the unitary rotation algorithm for pixellated images based on the finite oscillator model is unique, and can be inverted or concatenated. Yet we should underline that the unitary rotation algorithm requires that the value at every pixel in the rotated image depend on the values of all pixels of the input image. We are thus dealing with an O(N 4 ) dependence in the number of operations needed to compute a rotation. The obvious advantage of information conservation comes thus at the price of a lengthier computation time. For commercial applications, where N ≈ 10 3 is common, the more common image rotation algorithms based on interpolation in smaller regions of an image, have none of the former advantages, nor the last disadvantage.
The results presented for three basic colors of course also apply to any number of quantities that may be attached to the pixel values in pre-ordained ranges. The unitary rotations can also be made to act on the latter quantities covariantly, such as would be the case for a discrete and finite vector field, whose two components will rotate together with the data-image. Also, three-and higher-dimensional pixellated ('voxellated') images, subject to rotations [22] can be subject to considerations similar to those analyzed here.
Lastly, we should place the group of rotations of pixellated screens within the wider context of the finite oscillator model, which uses basically the rotation Lie subalgebra chain so(3) ⊃ so(2) to provide the pixel coordinates and a phase space interpretation for the system, as opposed to their usual numbering through the Npoint Fourier transform. In the latter, the position space forms a discrete torus whose two discrete (x, y) coordinates curl into circles, but where rotations between them cannot be applied without breaking the torus. In the finite oscillator model, the manifold harboring the coordinates is a sphere, which can be freely rotated and also gyrated in phase space, among other linear canonical transformations. the support of the National Council for Science and Technology (conacyt) through the Becas Postdoctorales program (2021).