Type: | Package |
Title: | Hadamard Matrix Generation |
Version: | 1.0.0 |
Maintainer: | Appavoo Dhandapani <dhandapani.appavoo@gmail.com> |
Description: | Generates Hadamard matrices using different construction methods. For those who want to generate Hadamard matrix, a generic function, Hadamard_matrix() is provided. For those who want to generate Hadamard matrix using a particular method, separate functions are available. See Horadam (2007, ISBN:9780691119212) Hadamard Matrices and their applications, Princeton University Press for more information on Hadamard Matrices. |
License: | GPL-2 |
Encoding: | UTF-8 |
LazyData: | TRUE |
Imports: | numbers, openxlsx |
RoxygenNote: | 7.1.0 |
Depends: | R (≥ 2.10) |
NeedsCompilation: | no |
Packaged: | 2020-04-06 16:23:21 UTC; Dhandapani |
Author: | Appavoo Dhandapani
|
Repository: | CRAN |
Date/Publication: | 2020-04-07 15:10:06 UTC |
Hadamard Matrices
Description
A square matrix H of order n with entries +1 or -1 is called Hadamard Matrix, if HH'=nI, where I is Identity matrix. Necessary condition for Hadamard matrix of order n exists when n = 1,2 or 0(mod 4).
Details
Using HadamardR, Hadamard Matrices of various orders can be generated. Out of 1250 possible Hadamard Matrices of order < 5000 (ignoring trivial orders 1 and 2), the construction methods are not known for 45 orders; 1158 orders are possible using Hadamard_Matrix() function. 47 Hadamard matrices not available in this package are as follows: 1336, 1432, 1940, 2212, 2264, 2292, 2316, 2488, 2740, 2776, 2864, 2872, 3140, 3352, 3476, 3544, 3620, 3684, 3704, 3708, 3820, 3832, 3880, 3892, 3896, 3928, 3972, 3980, 4044, 4120, 4152, 4184, 4268, 4296, 4304, 4344, 4396, 4404, 4432, 4528, 4572, 580, 4632, 4740, 4792, 4812, 4976
GFADD
Description
Addition table of GF(P^r)
Usage
GFADD(GFElem, p, r)
Arguments
GFElem |
integer (Can be obtained by calling GFELEM function) |
p |
integer (a prime number) |
r |
integer (a positive integer) |
Details
This function returns addition table of Galois field of order p^r. To use this function, Minimum function, elements of GF are required. Minimum functions are available in internal dataset. Elements can be generated using GFELEM function.
Value
A matrix of size p^r x p^r
Examples
p<-3
r<-2
cardin<-p^2
mf<-subset(HadamardR:::minimumfunction,HadamardR:::minimumfunction$s==cardin)
MF<-mf$coeff
GFElem<-GFELEM(p,r,MF)
GFADD(GFElem,p,r)
#Addition Table of GF(9)
GFCheck
Description
This is an internal function to return the position of argument add in elements of GF(cardin)
Usage
GFCheck(GFElem, r, cardin, add)
Arguments
GFElem |
integer array |
r |
integer |
cardin |
integer |
add |
integer array |
Details
This function is not exported. Used for checking the result of addition or multiplication of GFElements.
Value
i integer The position of the element checked in GFElem
GFELEM
Description
Elements of Galois Field, GF(P^r)
Usage
GFELEM(p, r, MF)
Arguments
p |
integer (a prime number) |
r |
integer (a positive integer) |
MF |
Integer Array containing Minimum function |
Details
This function returns Elements of Galois field of order p^r. To use this function, Minimum function is required. Minimum functions are available in internal dataset. To use the Minimum function from the internal, use HadamardR:::
Value
A vector of size p^r
Examples
library(HadamardR)
p<-3
r<-2
cardin=9
mf<-subset(HadamardR:::minimumfunction,HadamardR:::minimumfunction$s==cardin)
MF<-mf$coeff
GFElem<-GFELEM(p,r,MF)
GFElem
GFM GFM Generate Multiplication table of GF(p^r), where p is a prime power.
Description
GFM GFM Generate Multiplication table of GF(p^r), where p is a prime power.
Usage
GFM(cardin)
Arguments
cardin |
integer |
Details
This function returns Multiplication table of Galois field of order p^r. To use this function, Minimum function, elements of GF are required. Minimum functions are available in internal dataset. Elements can be generated using GFELEM function.
Value
Multiplication table of GF(p^r)
Examples
GFM(9)
## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
## [1,] 1 1 1 1 1 1 1 1 1
## [2,] 1 3 4 5 6 7 8 9 2
## [3,] 1 4 5 6 7 8 9 2 3
## [4,] 1 5 6 7 8 9 2 3 4
## [5,] 1 6 7 8 9 2 3 4 5
## [6,] 1 7 8 9 2 3 4 5 6
## [7,] 1 8 9 2 3 4 5 6 7
## [8,] 1 9 2 3 4 5 6 7 8
## [9,] 1 2 3 4 5 6 7 8 9
GFMult GFMult Generate Multiplication table of GF(p^r), where p is a prime power.
Description
GFMult GFMult Generate Multiplication table of GF(p^r), where p is a prime power.
Usage
GFMult(cardin)
Arguments
cardin |
integer |
Details
This function returns Multiplication table of Galois field of order p^r. To use this function, Minimum function, elements of GF are required. Minimum functions are available in internal dataset. Elements can be generated using GFELEM function.
Value
Multiplication table of GF(p^r)
Examples
GFMult(9)
## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
## [1,] 1 1 1 1 1 1 1 1 1
## [2,] 1 3 4 5 6 7 8 9 2
## [3,] 1 4 5 6 7 8 9 2 3
## [4,] 1 5 6 7 8 9 2 3 4
## [5,] 1 6 7 8 9 2 3 4 5
## [6,] 1 7 8 9 2 3 4 5 6
## [7,] 1 8 9 2 3 4 5 6 7
## [8,] 1 9 2 3 4 5 6 7 8
## [9,] 1 2 3 4 5 6 7 8 9
GFPrimeAdd
Description
GFPrimeAdd creates the addition Table for GF(p), where p is a prime number
Usage
GFPrimeAdd(p)
Arguments
p |
integer |
Details
If the elements of GF(p) are 0,1,..,p-1 then the (i,j)th element of matrix returned is addition of (i-1)th and (j-1)th elements. The additions are subjected to modulo p.
Value
Addition Table of GF(p) in the form of matrix of order p x p.
Examples
GFPrimeAdd(5)
#[,1] [,2] [,3] [,4] [,5]
#[1,] 0 1 2 3 4
#[2,] 1 2 3 4 0
#[3,] 2 3 4 0 1
#[4,] 3 4 0 1 2
#[5,] 4 0 1 2 3
GFPrimeMult GFPrimeMult creates Multiplication Table for GF(p), where p is a prime number
Description
GFPrimeMult GFPrimeMult creates Multiplication Table for GF(p), where p is a prime number
Usage
GFPrimeMult(p)
Arguments
p |
integer |
Details
If the elements of GF(p) are 0,1,..,p-1 then the (i,j)th element of matrix returned is multiplication of (i-1)th and (j-1)th elements. The multiplications are subjected to modulo p.
Value
Multiplication Table of GF(p) in the form of matrix of order p x p.
Examples
GFPrimeMult(5)
#[,1] [,2] [,3] [,4] [,5]
#[1,] 0 0 0 0 0
#[2,] 0 1 2 3 4
#[3,] 0 2 4 1 3
#[4,] 0 3 1 4 2
#[5,] 0 4 3 2 1
Get_method
Description
Get_method helps finding the given order of the matrix is constructed by which method.
Usage
Get_method(order)
Arguments
order |
integer |
Value
Method name of the given order.
Examples
Get_method(92) # Williamson method
Get_method(24)
# Paley I
Had_method
Description
Had_method performs the give order of the matrix is constructed by which method.
Usage
Had_method(order)
Arguments
order |
integer (order of the Hadamard matrix) |
Details
If the method number retuns, if it
1 kronecker method (power of 2 only)
2 PaleyI
3 PaleyII
4 Ehlich method
5 Williamson method
6 Baumert-Hall method
7 Goethals-Seidel by using Base sequences
8 Goethals-Seidel by using Turyn sequences
9 Miyamoto method
10 Suplimentary Difference Sets
11 Cooper-Wallis method
12 Kronecker product method
13 Goethals-Seidel by using T sequences
14 Paley I Prime Power
15 Paley II Prime Power
Value
Method number
Examples
Had_method(92) # "5"
Had_method(324) # "4"
Hadamard_Matrix
Description
Hadamard_Matrix is generic function for construction of Hadamard matrix.
Usage
Hadamard_Matrix(order)
Arguments
order |
integer |
Details
function Hadamard_matrix was created which does not require known of construction methods. Hadamard_matrix() takes an integer as input and returns Hadamard matrix if it is available. In case, it is not possible to construct, NULL value is returned.
Value
Hadamard Matrix of given Order
Examples
Hadamard_Matrix(1)
#1
Hadamard_Matrix(2)
# [,1] [,2]
# [1,] 1 1
# [2,] 1 -1
Hadamard_Matrix(8)
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
# [1,] 1 1 1 1 1 1 1 1
# [2,] 1 -1 1 -1 1 -1 1 -1
# [3,] 1 1 -1 -1 1 1 -1 -1
# [4,] 1 -1 -1 1 1 -1 -1 1
# [5,] 1 1 1 1 -1 -1 -1 -1
# [6,] 1 -1 1 -1 -1 1 -1 1
# [7,] 1 1 -1 -1 -1 -1 1 1
# [8,] 1 -1 -1 1 -1 1 1 -1
Hadamard_Matrix(10)
#"Order is not a Hadamard number"
Hadamard_Matrix(668)
#"Not possible to construct or order is not a multiple of 4"
Hadamard_Matrix_method
Description
Hadamard_Matrix_method it is also generic function but it provides some additional options.
Usage
Hadamard_matrix_method(order, type = -1, method = "", file = "", filetype = "")
Arguments
order |
integer |
type |
-1 or 0 |
method |
method=c("Kronecker", "PaleyI","PaleyII","Ehlich","Williamson","Baumert","Goethals-Seidel_Base", "Goethals-Seidel_Turyn","Miyamoto","Cooper-Wallis","Kronecker_Product_Method","PaleyIPrimepower","PaleyIIPrimePower") |
file |
Name of the file |
filetype |
xlsx or csv |
Details
If the method is not specified or incorrectly specified, Hadamard matrix will be constructed using Had_method function. If the method is specified, Hadamard matrix will be constructed using that method.
By default, the elements will be +1 or -1. Incase, -1 should be replaced by 0, use type=0.
TO save the generated matrix into a text file (csv) or MS-Excel, filename may be specified (with extension). In case Excel file required, use filetype = xlsx, otherwise csv file will be generated.
If just give the input as number it returns Hadamard matrix in console.
Value
Hadamard Matrix of given Order
Examples
Hadamard_matrix_method(4)
# [,1] [,2] [,3] [,4]
#[1,] 1 1 1 1
#[2,] 1 -1 1 -1
#[3,] 1 1 -1 -1
#[4,] 1 -1 -1 1
Hadamard_matrix_method(8,method = "PaleyI")
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
# [1,] 1 1 1 1 1 1 1 1
# [2,] -1 1 -1 -1 1 -1 1 1
# [3,] -1 1 1 -1 -1 1 -1 1
# [4,] -1 1 1 1 -1 -1 1 -1
# [5,] -1 -1 1 1 1 -1 -1 1
# [6,] -1 1 -1 1 1 1 -1 -1
# [7,] -1 -1 1 -1 1 1 1 -1
# [8,] -1 -1 -1 1 -1 1 1 1
Hadamard_matrix_method(12,method = "Williamson",
file = file.path(tempdir(), "Hadamard12.csv"))
#output saved in file
Hadamard_matrix_method(36,method = "Baumert",
file = file.path(tempdir(),"Hadamard36.xlsx"))
#output saved in file
Hadamard_matrix_method(20,method = "Miyamoto",
file = file.path(tempdir(),"Hadamard20.csv"),filetype = "csv")
#output saved in file
Hadamard_matrix_method(8,method =
"Kronecker",file = file.path(tempdir(),"Hadamard8.xlsx"), filetype = "xlsx")
#output saved in file
Initial_row_SDS Initial_row_SDS is an internal function.Not Exported.
Description
Initial_row_SDS Initial_row_SDS is an internal function.Not Exported.
Usage
Initial_row_SDS(i, j, v, n, r)
Arguments
i |
is the numeric vectors |
j |
is the numeric vectors |
v |
is the numeric vectors |
n |
is the numeric vectors |
r |
is the numeric vectors |
Details
All inputs are numeric vectors of same length. This function used in the COnstruction of Hadamard matrix by Supplementary Differences Sets It converts the SDS sets into binary forms (+1 or -1).
Value
Intial rows of Matrix.
References
Djokovic, D. Z. (1992a). Skew Hadamard matrices of order 4x37 and 4x39. J. Combin. Theory, A 61, 319-321.
Djokovic, D. Z. (1992b). Construction of some new Hadamard matrices. Bull. Austral. math. Soc., 45, 327-332.
Djokovic, D. Z. (1992c). Ten new Hadamard matrices of skew type. Publ.Electrotechnickog Fak., Ser. Mathematika, Univ. of Belgrade, 3, 47-59.
Djokovic, D. Z. (1992d). Ten Hadamard matrices of order 1852 of Goethals-Seidel type. Europ. J. Combinatorics, 13, 245-248.
Djokovic, D. Z. (1994a). Two Hadamard matrices of order 956 of Goethals-Seidel type. Combinatorica, 14(3), 375-377.
Djokovic, D. Z. (1994b). Five new Hadamard matrices of order skew type. Austral. J. Combinatorics, 10, 259-264.
Jmat
Description
Jmat peforms the generation of unit matrix.
Usage
Jmat(n)
Arguments
n |
integer |
Details
An J matrix is a square matrix where all the entries are one.
Value
square matrix of order n
Examples
Jmat(4)
# [,1] [,2] [,3] [,4]
#[1,] 1 1 1 1
#[2,] 1 1 1 1
#[3,] 1 1 1 1
#[4,] 1 1 1 1
Normcol Normcol performs the Normalisation of column the given matrix.
Description
Normcol Normcol performs the Normalisation of column the given matrix.
Usage
Normcol(m)
Arguments
m |
Matrix |
Details
For the given matrix of the first column of the all the -1 elements converting +1 without alter the property of the matrix.
Value
Normalised matrix
Examples
PaleyI(8)
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#[1,] 1 1 1 1 1 1 1 1
#[2,] -1 1 -1 -1 1 -1 1 1
#[3,] -1 1 1 -1 -1 1 -1 1
#[4,] -1 1 1 1 -1 -1 1 -1
#[5,] -1 -1 1 1 1 -1 -1 1
#[6,] -1 1 -1 1 1 1 -1 -1
#[7,] -1 -1 1 -1 1 1 1 -1
#[8,] -1 -1 -1 1 -1 1 1 1
Normcol(PaleyI(8))
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#[1,] 1 1 1 1 1 1 1 1
#[2,] 1 -1 1 1 -1 1 -1 -1
#[3,] 1 -1 -1 1 1 -1 1 -1
#[4,] 1 -1 -1 -1 1 1 -1 1
#[5,] 1 1 -1 -1 -1 1 1 -1
#[6,] 1 -1 1 -1 -1 -1 1 1
#[7,] 1 1 -1 1 -1 -1 -1 1
#[8,] 1 1 1 -1 1 -1 -1 -1
Normrow Normcol performs the Normalisation of row the given matrix.
Description
Normrow Normcol performs the Normalisation of row the given matrix.
Usage
Normrow(m)
Arguments
m |
Matrix |
Details
For the given matrix of the first row of the all the -1 elements converting +1 without alter the property of the matrix.
Value
Normalised matrix
Examples
PaleyII(12)
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
# [1,] 1 1 1 1 1 1 1 -1 -1 -1 -1 -1
# [2,] 1 1 1 -1 -1 1 -1 1 -1 1 1 -1
# [3,] 1 1 1 1 -1 -1 -1 -1 1 -1 1 1
# [4,] 1 -1 1 1 1 -1 -1 1 -1 1 -1 1
# [5,] 1 -1 -1 1 1 1 -1 1 1 -1 1 -1
# [6,] 1 1 -1 -1 1 1 -1 -1 1 1 -1 1
# [7,] 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
# [8,] -1 1 -1 1 1 -1 -1 -1 -1 1 1 -1
# [9,] -1 -1 1 -1 1 1 -1 -1 -1 -1 1 1
#[10,] -1 1 -1 1 -1 1 -1 1 -1 -1 -1 1
#[11,] -1 1 1 -1 1 -1 -1 1 1 -1 -1 -1
#[12,] -1 -1 1 1 -1 1 -1 -1 1 1 -1 -1
Normrow(PaleyII(12))
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
# [1,] 1 1 1 1 1 1 1 1 1 1 1 1
# [2,] 1 1 1 -1 -1 1 -1 -1 1 -1 -1 1
# [3,] 1 1 1 1 -1 -1 -1 1 -1 1 -1 -1
# [4,] 1 -1 1 1 1 -1 -1 -1 1 -1 1 -1
# [5,] 1 -1 -1 1 1 1 -1 -1 -1 1 -1 1
# [6,] 1 1 -1 -1 1 1 -1 1 -1 -1 1 -1
# [7,] 1 -1 -1 -1 -1 -1 -1 1 1 1 1 1
# [8,] -1 1 -1 1 1 -1 -1 1 1 -1 -1 1
# [9,] -1 -1 1 -1 1 1 -1 1 1 1 -1 -1
#[10,] -1 1 -1 1 -1 1 -1 -1 1 1 1 -1
#[11,] -1 1 1 -1 1 -1 -1 -1 -1 1 1 1
#[12,] -1 -1 1 1 -1 1 -1 1 -1 -1 1 1
PaleyI
Description
This function performs constructing the Hadamard matrix by Paley method.
Usage
PaleyI(n)
Arguments
n |
integer (order of the matrix) |
Details
let q = n-1 , and q = 3 (mod 4), q is the prime number, then obtained the Hadamard matrix of order q+1.if input satisfies these condition it retuns Hadamard Matrix; otherwise returns NULL.
Value
hadamard matrix of n
References
Paley, R.E.A.C. (1933). On Orthogonal matrices. J. Combin. Theory, A 57(1), 86-108.
Examples
PaleyI(8)
#' PaleyI(8)
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#[1,] 1 1 1 1 1 1 1 1
#[2,] -1 1 -1 -1 1 -1 1 1
#[3,] -1 1 1 -1 -1 1 -1 1
#[4,] -1 1 1 1 -1 -1 1 -1
#[5,] -1 -1 1 1 1 -1 -1 1
#[6,] -1 1 -1 1 1 1 -1 -1
#[7,] -1 -1 1 -1 1 1 1 -1
#[8,] -1 -1 -1 1 -1 1 1 1
PaleyI(16)
#NULL
PaleyII
Description
This function create the Hadamard matrix by Paley method 2
Usage
PaleyII(n)
Arguments
n |
integer(order of the matrix) |
Details
q=n/2-1, If there is an Hadamard matrix of order h>1, and q = 1 (mod 4) is a prime number, then there exists an Hadamard matrix of order nh.
Value
Hadamard matrix of order n
References
Paley, R.E.A.C. (1933). On Orthogonal matrices. J. Combin. Theory, A 57(1), 86-108.
Examples
PaleyII(12)
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
# [1,] 1 1 1 1 1 1 1 -1 -1 -1 -1 -1
# [2,] 1 1 1 -1 -1 1 -1 1 -1 1 1 -1
# [3,] 1 1 1 1 -1 -1 -1 -1 1 -1 1 1
# [4,] 1 -1 1 1 1 -1 -1 1 -1 1 -1 1
# [5,] 1 -1 -1 1 1 1 -1 1 1 -1 1 -1
# [6,] 1 1 -1 -1 1 1 -1 -1 1 1 -1 1
# [7,] 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
# [8,] -1 1 -1 1 1 -1 -1 -1 -1 1 1 -1
# [9,] -1 -1 1 -1 1 1 -1 -1 -1 -1 1 1
#[10,] -1 1 -1 1 -1 1 -1 1 -1 -1 -1 1
#[11,] -1 1 1 -1 1 -1 -1 1 1 -1 -1 -1
#[12,] -1 -1 1 1 -1 1 -1 -1 1 1 -1 -1
PaleyII(8)
#NULL
PaleyIIPrimePower
Description
PaleyIIPrimePower
Usage
PaleyIIPrimePower(order)
Arguments
order |
integer |
Details
q=n/2-1, If there is an Hadamard matrix of order h>1, and q = 1 (mod 4) is a prime power, then there exists an Hadamard matrix of order nh.
Value
Hadamard matrix of the given order.
References
Paley, R.E.A.C. (1933). On Orthogonal matrices. J. Combin. Theory, A 57(1), 86-108.
Examples
PaleyIIPrimePower(20)
PaleyIIPrimePower(24)
PaleyIPrimePower
Description
PaleyIPrimePower
Usage
PaleyIPrimePower(n)
Arguments
n |
integer |
Details
let q = n-1 , and q = 3 (mod 4), q is the prime power, then obtained the Hadamard matrix of order q+1.if input satisfies these condition it retuns Hadamard Matrix; otherwise returns NULL.
Value
Hadamard matrix
References
Paley, R.E.A.C. (1933). On Orthogonal matrices. J. Combin. Theory, A 57(1), 86-108.
Examples
PaleyIPrimePower(28)
PaleyIPrimePower(28)
#NULL
QPrimePower QPrimePower creats the Quadratic residues of the prime number.
Description
QPrimePower QPrimePower creats the Quadratic residues of the prime number.
Usage
QPrimePower(cardin)
Arguments
cardin |
integer |
Details
The given input is prime power it retuns the matrix of order cardin. if the input is not prime number then it returns NULL.
Value
matrix of cardin x cardin
Examples
QPrimePower(9)
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
#[1,] 0 1 -1 1 -1 1 -1 1 -1
#[2,] 1 0 1 -1 1 1 -1 -1 -1
#[3,] -1 1 0 -1 1 -1 -1 1 1
#[4,] 1 -1 -1 0 1 -1 1 1 -1
#[5,] -1 1 1 1 0 -1 1 -1 -1
#[6,] 1 1 -1 -1 -1 0 1 -1 1
#[7,] -1 -1 -1 1 1 1 0 -1 1
#[8,] 1 -1 1 1 -1 -1 -1 0 1
#[9,] -1 -1 1 -1 -1 1 1 1 0
QPrimePower(36)
#NULL
T_seq T_seq performs the selection of the T sequences from dataset.internal function not exported.
Description
T_seq T_seq performs the selection of the T sequences from dataset.internal function not exported.
Usage
T_seq(order)
Arguments
order |
integer |
Details
Create T sequences of given order from the internal dataset T_sequences
T-sequences are available for length of seq(1,73,2) and 83, 101 and 107 in the internal table.
Value
Required Turyn sequences of order of x
Source
The Turyn sequences were obtained from Christos Koukouvinos.
References
Goethals, J. M. and Seidel, J. J. (1967). Orthogonal matrices with zero diagnol. Canad. J. Math., 19, 259-264.
See Also
had_goethals_T
for Goethals-Seidel construction method using T-sequences.
Turyn_seq Turyn_seq performs the selection of the Turyn sequences from dataset. It is internal function not exported.
Description
Turyn_seq Turyn_seq performs the selection of the Turyn sequences from dataset. It is internal function not exported.
Usage
Turyn_seq(order)
Arguments
order |
integer |
Details
Create Turyn sequences of given order from the internal dataset T_sequences
Turyn type-sequences are available for 28,30,34,36 in the internal table.
Value
Required Turyn sequences of order of x
References
Goethals, J. M. and Seidel, J. J. (1967). Orthogonal matrices with zero diagnol. Canad. J. Math., 19, 259-264.
See Also
had_goethals_Turyn
for Goethals-Seidel construction method using Turyn sequences.
#'
Turyn_to_T internal function. converts Turyn sequences to Base Sequences.
Description
Turyn_to_T internal function. converts Turyn sequences to Base Sequences.
Usage
Turyn_to_T(dat1, order)
Arguments
dat1 |
is the Turyn sequences subset exported from Tseq |
order |
integer (order of the matrix) |
Details
dat - Internal dataset containing 4 sequences in long form with lentgh 2n-1, 2n-1, n, n. Using the 4 Turyn sequences, the function creates 4 sequences of length n+p, n+p, n, n. Base Sequnces are usually used in creating matrices of Goethel Seidal array.
Turyn type-sequences are available for 28,30,34,36 in the internal table.
Value
Basesequences of length of order
References
Goethals, J. M. and Seidel, J. J. (1967). Orthogonal matrices with zero diagnol. Canad. J. Math., 19, 259-264.
See Also
had_goethals_Turyn
for Goethals-Seidel construction method using Turyn sequences.
antidiagnol
Description
antidiagnol performs the creation of Back diagnol matrix.
Usage
antidiagnol(n)
Arguments
n |
integer |
Details
An anti-diagonal matrix is a square matrix where all the entries are zero except those on the diagonal going from the lower left corner to the upper right corner entries are equal to 1.
In the first row, the last column will be 1 and all other entries are 0.
In second row, last but one column is 1 and others are 0 and so on.
Value
Antidiagnol matrix of order n.
Examples
antidiagnol(4)
#0 0 0 1
#0 0 1 0
#0 1 0 0
#1 0 0 0
Base_to_T
Description
internal function and it is not exported. It converts base sequences to T-Sequences.
Usage
base_to_T(dat, x)
Arguments
dat |
is the frame containing basesequences to be exported |
x |
integer (order of the base sequence) |
Details
dat - Internal dataset containing 4 sequences in long form with lentgh n+p,n+p,n,n. Using the 4 basequences, the function creates 4 sequences of length 2n+p,2n+p,2n+p,2n+p. T-Sequnces are usually used in creating matrices of Goethel Seidal array.
Value
4 T-sequences of length of 2x+p.
Source
The Base sequences were obtained from Christos Koukouvinos
References
Goethals, J. M. and Seidel, J. J. (1967). Orthogonal matrices with zero diagnol. Canad. J. Math., 19, 259-264.
baseseq
Description
Extracts the selection of Basesequences from internal dataset. Not exported.
Usage
baseseq(order)
Arguments
order |
integer |
Details
Create Basesequence of given order from the internal dataset Basesequence Base sequences are available in the internal table for order= 1:35
Value
Required Basesequences of order of x
Source
The Base sequences were obtained from Christos Koukouvinos
References
Goethals, J. M. and Seidel, J. J. (1967). Orthogonal matrices with zero diagnol. Canad. J. Math., 19, 259-264.
cdn_PaleyI Checks Hadamard Matrix can be constructed using Paley I method.
Description
cdn_PaleyI Checks Hadamard Matrix can be constructed using Paley I method.
Usage
cdn_PaleyI(order)
Arguments
order |
integer |
Details
In Paley I method, if q=order-1 and q is prime number and q=3 (mod 4) then the function retuns 2 otherwise NULL.
Value
2 or NULL
References
Paley, R.E.A.C. (1933). On Orthogonal matrices. J. Combin. Theory, A 57(1), 86-108.
See Also
PaleyI
for Paley I construction method.
Examples
cdn_PaleyI(8)
#2
cdn_PaleyI(16)
#NULL
cdn_PaleyII Checks Hadamard Matrix can be constructed using Paley II method.
Description
cdn_PaleyII Checks Hadamard Matrix can be constructed using Paley II method.
Usage
cdn_PaleyII(order)
Arguments
order |
integer |
Details
In Paley II method, If q=order/2-1 or q=order/4-1 and q is prime number and q=1 (mod 4) then this function retuns 3 otherwise NULL.
Value
3 or NULL
References
Paley, R.E.A.C. (1933). On Orthogonal matrices. J. Combin. Theory, A 57(1), 86-108.
See Also
PaleyII
for Paley II construction method.
Examples
cdn_PaleyII(24)
#3
cdn_PaleyII(16)
#NULL
cdn_PaleyIIprimepower checks Hadamard Matrix can be constructed using Paley II method.
Description
cdn_PaleyIIprimepower checks Hadamard Matrix can be constructed using Paley II method.
Usage
cdn_PaleyIIprimepower(order)
Arguments
order |
integer |
Details
In Paley II method, q=order/2-1 and q is prime power and q=1 (mod 4) then it retuns 15 otherwise NULL.
Value
15 or NULL
References
Paley, R.E.A.C. (1933). On Orthogonal matrices. J. Combin. Theory, A 57(1), 86-108.
See Also
PaleyIIPrimePower
for Paley construction method.
Examples
cdn_PaleyIIprimepower(340)
#15
cdn_PaleyIIprimepower(64)
#NULL
cdn_PaleyIprimepower checks Hadamard Matrix can be constructed using Paley I method.
Description
cdn_PaleyIprimepower checks Hadamard Matrix can be constructed using Paley I method.
Usage
cdn_PaleyIprimepower(order)
Arguments
order |
integer |
Details
In Paley I method, If q=order-1 and q is prime power and q=3 (mod 4) then it retuns 14 otherwise NULL.
Value
14 or NULL
References
Paley, R.E.A.C. (1933). On Orthogonal matrices. J. Combin. Theory, A 57(1), 86-108.
See Also
PaleyIPrimePower
for Paley I construction method.
Examples
cdn_PaleyI(28)
#14
cdn_PaleyI(16)
#NULL
cdn_baumert
Description
Checks Hadamard Matrix can be constructed using Baumert-Hall arrays of order 12.
Usage
cdn_baumert(order)
Arguments
order |
integer, order of Hadamard matrix to be checked. |
Details
Baumert-Hall array is a generalization of Williamson Array. In case, Williamson matrices are available for order/12, the method return 6 otherwise it returns NULL.
The availabile Williamson sequences in the internal data sets is seq(1,63, 2) except 15, 35, 47, 53, 59 in the internal table.
Value
6 or NULL
References
Hedayat, A. and Wallis, W. D.(1978). Hadamard Matrices and Their Applications. Ann. Stat. 6: 1184-1238.
See Also
had_baumert
for Baumert-Hall's construction method.
Examples
cdn_baumert(36)
#6
cdn_baumert(72)
#NULL
cdn_cooper
Description
Checks Hadamard Matrix can be constructed using Williamson arrays and T- sequences.
Usage
cdn_cooper(order)
Arguments
order |
integer |
Details
Cooper-Wallis is a construction of Hadamard matrices which combines Williamson matrices and T-sequences.
The availabile Williamson sequences in the internal data sets is seq(1,63, 2) except 15, 35, 47, 53, 59 in the internal table.
The availabile T- sequences in the internal data sets is seq(1,73,2) and 83, 101, 107.
Value
11 or NULL
References
Cooper, J., and Wallis, W., D. (1972). A construction for Hadamard arrays. Bull. Austral. Math. 7, 269-278.
See Also
had_cooper
for Cooper-Wallis construction method.
get_cooper
for finding order of Williamson and T-Sequences.
Examples
cdn_cooper(20)
#11
cdn_cooper(16)
#NULL
cdn_ehlich
Description
Checks Hadamard Matrix can be constructed using Ehlich's method.
Usage
cdn_ehlich(order)
Arguments
order |
integer |
Details
Ehlich (1965)'s construction method requires order of the Hadamard matrix must be a of the form (n-1)^2. Conditions are (i)Order=(n-1)^2; (ii) n is a prime or prime power and 3(mod 4). (iii) (n-2) must be a prime or prime power. In case, if all the three conditions are satisfied, function will return 4 or NULL.
Value
4 or NULL
References
Ehlich, H. (1965). Neue Hadamard-matrizen. Arch. Math., 16, 34-36.
See Also
had_ehlich
for Ehlich's construction method.
Examples
cdn_ehlich(36)
#Condition 1:(n-1)^2 = 36 = 6^2
#Condition 2: n=7 (prime)and n=3(mod 4)
#Condition 3: n-2=5 (prime)
#Return
#4
cdn_ehlich(64)
#Condition 1:(n-1)^2 = 64 = 8^2
#Condition 2: n=9 (prime power) but n=1(mod 4).
#Condition 2 fails
#Return
#NULL
cdn_goethals_T
Description
Checks Hadamard Matrix can be constructed using available T-sequences.
Usage
cdn_goethals_T(order)
Arguments
order |
integer |
Details
This function checks whether the Hadamard matrix of given order can be constructed using T sequences. If T sequences of length n,n,n,n are available, Hadamard matrix of order 4n can be constructed. Returns the value 13, if it is possible otherwise NULL is returned.
T-sequences are available for length of seq(1,73,2) and for 83, 101 and 107 in the internal table.
Value
13 or NULL
See Also
had_goethals_T
for Goethals-Seidel construction method using T-sequences.
Examples
cdn_goethals_T(28)
#T-seqeunce of length 7 exists.
#13
cdn_goethals_T(24)
#T-sequence of length 6 does not exist.
#NULL
cdn_goethals_Turyn
Description
Checks Hadamard Matrix can be constructed using available Turyn Type sequences.
Usage
cdn_goethals_Turyn(order)
Arguments
order |
integer |
Details
This function checks whether the Hadamard matrix of given order can be constructed using Turyn sequences. If Turyn sequences of (order+4)/12 is available then Hadamard matrix of order exists. Returns the value 8, if it is possible otherwise NULL is returned.
Turyn type-sequences are available for 28,30,34,36 in the internal table.
Value
8 or NULL
See Also
had_goethals_Turyn
for Goethals-Seidel construction method using Turyn sequences.
Examples
cdn_goethals_Turyn(356)
#8
cdn_goethals_Turyn(40)
#NULL
cdn_goethals_base
Description
Checks Hadamard Matrix can be constructed using available base sequences.
Usage
cdn_goethals_base(order)
Arguments
order |
integer |
Details
This function checks whether the Hadamard matrix of given order can be constructed using base sequences. If base sequences of length n+1,n+1,n,n are available, T-sequences of length 2n+1,2n+1,2n+1,2n+1 can be constructed. From T-sequence of length 2n+1, Hadamard matrix of order 4(2n+1) can be constructed. Returns the value 7, if it is possible otherwise NULL is returned.
Base sequences are available in the internal dataset is 1:35
Value
7 or NULL
Source
The Base sequences were obtained from Christos Koukouvinos
References
Goethals, J. M. and Seidel, J. J. (1967). Orthogonal matrices with zero diagnol. Canad. J. Math., 19, 259-264.
See Also
had_goethals_base
for Goethals-Seidel construction method.
Examples
cdn_goethals_base(20)
#7
cdn_goethals_base(24)
#NULL
cdn_kronecker_matrix
Description
Checks Hadamard Matrix can be constructed by multiplying 2 existing Hadamard matrix.
Usage
cdn_kronecker_matrix(r)
Arguments
r |
integer |
Details
This function checks whether the Hadamard matrix can be constructed as multiple of 2 Hadamard matrix. Returns the value 12, if it is possible otherwise NULL is returned.
Value
12 or NULL
Examples
cdn_kronecker_matrix(8)
#12
cdn_kronecker_matrix(12)
#NULL
cdn_miyamoto
Description
Checks Hadamard Matrix can be constructed using Ehlich's method.
Usage
cdn_miyamoto(order)
Arguments
order |
integer |
Details
In Miyamoto construction, if q= n/4 and q is a prime or prime power and q=1 (mod 4),then there exists an Hadamard Matrix of order n.
Value
9 or NULL
References
Miyamoto, M. (1991). A Construction of Hadamard matrices. J. Math. Phy., 12, 311-320.
See Also
had_miyamoto
for Miyamoto's construction method.
Examples
cdn_miyamoto(20)
#q=5, is a prime number and q=1(mod 4).
#9
cdn_miyamoto(16)
#NULL
cdn_sds
Description
Checks Hadamard Matrix can be constructed using available Suplementary Difference Sets.
Usage
cdn_sds(order)
Arguments
order |
integer |
Details
This function checks whether the Hadamard matrix of given order can be constructed using Suplementary Diffrence sets. If SDS is available it Returns the value 10 otherwise NULL.
SDS are available for 103,127,151,163,181,191,239,251,463,631 in the internal table.
Value
10 or NULL
Source
SDS sets are availble from Djokovic (1992a,b,c,d and 1994a,1994b).
References
Djokovic, D. Z. (1992a). Skew Hadamard matrices of order 4x37 and 4x39. J. Combin. Theory, A 61, 319-321.
Djokovic, D. Z. (1992b). Construction of some new Hadamard matrices. Bull. Austral. math. Soc., 45, 327-332.
Djokovic, D. Z. (1992c). Ten new Hadamard matrices of skew type. Publ.Electrotechnickog Fak., Ser. Mathematika, Univ. of Belgrade, 3, 47-59.
Djokovic, D. Z. (1992d). Ten Hadamard matrices of order 1852 of Goethals-Seidel type. Europ. J. Combinatorics, 13, 245-248.
Djokovic, D. Z. (1994a). Two Hadamard matrices of order 956 of Goethals-Seidel type. Combinatorica, 14(3), 375-377.
Djokovic, D. Z. (1994b). Five new Hadamard matrices of order skew type. Austral. J. Combinatorics, 10, 259-264.
See Also
had_SDS
for SDS construction method.
Examples
cdn_sds(412)
#10
cdn_sds(428)
#NULL
cdn_williamson
Description
Checks Hadamard Matrix can be constructed using available Williamson sequences.
Usage
cdn_williamson(order)
Arguments
order |
integer |
Details
This function checks whether the Hadamard matrix of given order can be constructed using williamson sequences. If Williamson sequences of length n,n,n,n are available, Hadamard matrix of order 4n can be constructed. Returns the value 5, if it is possible otherwise NULL is returned.
Williamson sequences are available for length of seq(1,63, 2) except 15, 35, 47, 53, 59 in the internal table.
Value
5 or NULL
Source
The Williamson sequences were obtained from Christos Koukouvinos and London (2013).
References
Williamson, J. (1944). Hadamard determinant theorem and the sum of four squares. Duke. Math. J., 11, 65-81.
Williamson, J. (1947). Note on Hadamard's determnant theorem. Bull. Amer. Math. Soc., 53, 608-613.
London, S. 2013. Constructing New Turyn Type Sequences, T-Sequences and Hadamard Matrices. PhD Thesis, University of Illinois at Chicago, Chicago.
See Also
had_williamson
for Williamson construction method using Williamson sequences.
Examples
cdn_williamson(20)
#5
cdn_goethals_T(24)
#NULL
check_hadamard
Description
check_hadamard tests whether the input matrix is an Hadamard matrix or not.
Usage
check_hadamard(x)
Arguments
x |
matrix |
Details
This function can be used to check whether a given matrix is an Hadamard Matrix or not. To ensure that generated matrix is indeed an Hadamard matrix, this function can be used. In case, if the given matrix is an Hadamard matrix, a text message, Given matrix is an Hadamard Matrix of order is printed on the console.
This function checks (i)Input is a matrix; (ii)a square matrix; (iii)Order of the matrix is an Hadamard number; (iv) All elements are either +1 or -1; (v) HH'=nI, where n is the order of the input matrix H and H' is transpose of H.
Value
returns a text message
References
Hedayat, A. and Wallis, W.D. (1978). Hadamard Matrices and Their Application.Ann. Stat., 6, 1184-1238.
Examples
#Example 1:
h<-matrix(c(1,1,1,-1),nrow=2,ncol=2)
check_hadamard(h)
# Given matrix is an Hadamard Matrix of order 2
#Example 2:
h<-matrix(c(1,-1,1,-1),nrow=2,ncol=2)
check_hadamard(h)
#Not an Hadamard matrix
#Example 3:
h<-Hadamard_Matrix(36)
check_hadamard(h)
#"Given matrix is an Hadamard Matrix of order 36"
circulant_mat
Description
A matrix is said to be circulant if (i+1, j+1)th entry is equal to the (i, j)th entry. Thus, for such matrices, the initial row determines the complex matrix. Whenever i+1,j+1 exceeds the order, modulus operation is carried out.
Usage
circulant_mat(x = NA)
Arguments
x |
a vector to be used as intial row. |
Details
circulant_mat performs construction of circulant matrices.
Value
circulant matrix of order length of input vector.
References
Hedayat, A. and Wallis, W.D. (1978). Hadamard Matrices and Their Application.Ann. Stat., 6, 1184-1238.
Examples
circulant_mat(c(1,1,-1,0))
# [,1] [,2] [,3] [,4]
#[1,] 1 1 -1 0
#[2,] 0 1 1 -1
#[3,] -1 0 1 1
#[4,] 1 -1 0 1
circulant_mat(c(5,9,-7,-2))
# [,1] [,2] [,3] [,4]
#[1,] 5 9 -7 -2
#[2,] -2 5 9 -7
#[3,] -7 -2 5 9
#[4,] 9 -7 -2 5
get_cooper
Description
This function provides the Williamson Matrix order and T-Sequence length required to construct Hadamard matrix.
Usage
get_cooper(x)
Arguments
x |
integer Hadamard Matrix Order to Check |
Details
If m is the order of T-Sequence and n is the order of Williamson sequence and both exists. Cooper and Wallis (1972) showed a construction method for Hadamard matrix of order 4mn exists. This function returns m and n if they exists otherwise NULL value is returned.
Value
m Tsequence order
n Williamson order
References
Cooper, J., and Wallis, J. 1972. A construction for Hadamard arrays. Bull. Austral. Math. Soc., 07: 269-277.
Examples
get_cooper(340)
#$m
#[1] 5
#$n
#[1] 17
get_cooper(256)
#NULL
goethals_seidel_array
Description
goethals_seidel_array performs the construction of Hadamard matrix by Goethals-Seidel method
Usage
goethals_seidel_array(A = NA, B = NA, C = NA, D = NA)
Arguments
A |
matrix |
B |
matrix |
C |
matrix |
D |
matrix |
Details
For this function requrires the four matrices, all the four matrix are Circulant matrices same order.R is an antidiagonal matrix of the same order With which it should satisfy the AA'+ BB'+ CC'+ DD'=4nI, where I is the identity matrix of order n. This function returns matrix of order 4n where n is the order of the given matrices.
Value
goethals_seidel matrix of order 4n
References
Goethals, J. M. and Seidel, J. J. (1967). Orthogonal matrices with zero diagnol. Canad. J. Math., 19, 259-264.
had_SDS
Description
had_SDS performs the construction of Hadamard matrix from SDS.
Usage
had_SDS(x)
Arguments
x |
integer (order of the matrix) |
Details
This function construct the Hadamard matrix of given order can be constructed using Suplementary Diffrence sets. For given order the SDS set is not available it retuns NULL If SDS is available it Returns Hadamard matrix of given order.
SDS are available for 103,127,151,163,181,191,239,251,463,631 in the internal table.
Value
Hadamard matrix of order x
References
Djokovic, D. Z. (1992a). Skew Hadamard matrices of order 4x37 and 4x39. J. Combin. Theory, A 61, 319-321.
Djokovic, D. Z. (1992b). Construction of some new Hadamard matrices. Bull. Austral. math. Soc., 45, 327-332.
Djokovic, D. Z. (1992c). Ten new Hadamard matrices of skew type. Publ.Electrotechnickog Fak., Ser. Mathematika, Univ. of Belgrade, 3, 47-59.
Djokovic, D. Z. (1992d). Ten Hadamard matrices of order 1852 of Goethals-Seidel type. Europ. J. Combinatorics, 13, 245-248.
Djokovic, D. Z. (1994a). Two Hadamard matrices of order 956 of Goethals-Seidel type. Combinatorica, 14(3), 375-377.
Djokovic, D. Z. (1994b). Five new Hadamard matrices of order skew type. Austral. J. Combinatorics, 10, 259-264.
Examples
had_SDS(412)
had_SDS(508)
had_baumert
Description
had_baumert performs the constrution of Hadamard matrix by Baumert-Hall method.
Usage
had_baumert(n)
Arguments
n |
integer (order of the matrix) |
Details
Baumert-Hall arrays extension of the williamson array. For construction of matrix it requires the Williamson sequences.For different order of the matrix it requries different williamson sequences.If williamson sequences are not available it Returns NULL.
Williamson sequences are available for length of seq(1,63, 2) except 15, 35, 47, 53, 59 in the internal table.
Value
Hadamard matrix of order n
Source
The Williamson sequences are available in London (2013) and Christos Koukouvinos
References
Baumert, L. D., and Hall, M. Jr. (1965). A new construction method for Hadamard matrices. Bull. Amer. Math. Soc., 71, 169-170
Hedayat, A. and Wallis, W.D. (1978). Hadamard Matrices and Their Application. Ann. Stat., 6, 1184-1238.
London, S. 2013. Constructing New Turyn Type Sequences, T-Sequences and Hadamard Matrices. PhD Thesis, University of Illinois at Chicago, Chicago.
Examples
had_baumert(372)
#Big matrix.
had_baumert(24)
#NULL
had_cooper
Description
had_cooper performs the construction of Hadamard matrix by Cooper-Wallis method.In which combines the williamson matrices and T-sequences.
Usage
had_cooper(n)
Arguments
n |
integer (order of the matrix=876) |
Value
Hadamard matrix of order n
Source
The williamson sequences and Turyn sequences were obtained from Christos Koukouvinos
References
Cooper, J. and Wallis, W. D. (1972). A construction for Hadamard arrays. Bull. Austral. Math. 7, 269-278.
had_ehlich
Description
had_ehlich performs the construction of Hadamard matrix by Ehlich method
Usage
had_ehlich(x)
Arguments
x |
Integer (order of the Hadamard matrix) |
Details
Ehlich (1965)'s construction method requires order of the Hadamard matrix must be a of the form (n-1)^2. Conditions are (i)Order=(n-1)^2; (ii) n is a prime or prime power and 3(mod 4); (iii) (n-2) must be a prime or prime power. In case, if all the three conditions are satisfied,then function will return Hadamard matrix of order x otherwise NULL.
Value
Hadamard matrix of order x
References
Ehlich, H. (1965). Neue Hadamard-matrizen. Arch. Math., 16, 34-36.
Examples
had_ehlich(36)
had_ehlich(20)
#NULL
had_goethals_T had_goethals_Turyn performs the Hadamard Matrix from Goethals-Seidel method by using T sequences.
Description
had_goethals_T had_goethals_Turyn performs the Hadamard Matrix from Goethals-Seidel method by using T sequences.
Usage
had_goethals_T(n)
Arguments
n |
integer (order of the matrix) |
Details
This function construct Hadamard matrix of given order using T sequences. If T sequences of length n,n,n,n are available, Hadamard matrix of order 4n can be constructed. Returns the Hadamard matrix of given order. If for given order the T sequences are not available returns NULL.
The T sequences are stored in internal dataset. The available T sequences of length is seq(1,73,2) and 83, 101 and 107
Value
Hadamard matrix of order x
Source
The T sequences are available at London (2013) and The Base sequences were obtained from Christos Koukouvinos
References
Goethals, J. M. and Seidel, J. J. (1967). Orthogonal matrices with zero diagnol. Canad. J. Math., 19, 259-264.
London, S. 2013. Constructing New Turyn Type Sequences, T-Sequences and Hadamard Matrices. PhD Thesis, University of Illinois at Chicago, Chicago.
Examples
had_goethals_T(4)
# [,1] [,2] [,3] [,4]
# [1,] 1 -1 -1 -1
# [2,] 1 1 -1 1
# [3,] 1 1 1 -1
# [4,] 1 -1 1 1
had_goethals_T(8)
#NULL
had_goethals_Turyn
Description
had_goethals_Turyn performs the Hadamard Matrix from Goethals-Seidel method by using Turyn sequences.
Usage
had_goethals_Turyn(r)
Arguments
r |
integer (order of the matrix) |
Details
This function construct Hadamard matrix of given order using Turyn sequences. If Turyn sequences of length 2n-1, 2n-1, n, n is available then Turyn sequences are converted in T sequences of length 2n+p, 2n+p, 2n+p, 2n+p and p=n-1, these T sequences are used for construction of Hadamard matrix. If the given order of the the Turyn sequences are not available it returns NULL.
Turyn type-sequences are available for 28,30,34,36 in the internal dataset.
Value
Hadamard matrix of order r
Source
The Base sequences were obtained from Christos Koukouvinos
References
Goethals, J. M. and Seidel, J. J. (1967). Orthogonal matrices with zero diagnol. Canad. J. Math., 19, 259-264.
Examples
#Big matrices
had_goethals_Turyn(356)
had_goethals_Turyn(404)
had_goethals_base
Description
had_goethals_base performs the construction of Hadamard Matrix from Goethals-Seidel method. by using the Base sequences.
Usage
had_goethals_base(x)
Arguments
x |
integer (order of the matrix) |
Details
This function construct the Hadamard matrix of given order using base sequences. If base sequences of length n+1,n+1,n,n are available, base sequences are converted into T-sequences of length 2n+1,2n+1,2n+1,2n+1 can be constructed. From T-sequence of length 2n+1, Hadamard matrix of order 4(2n+1) can be constructed. For a given order the base sequences is not available it returns NULL.
The Base sequences are stored in internal dataset. The available Base sequences of length is 1,2,3,4,.....,35
Value
Hadamard matrix of order x
Source
The Base sequences were obtained from Christos Koukouvinos
References
Goethals, J. M. and Seidel, J. J. (1967). Orthogonal matrices with zero diagnol. Canad. J. Math., 19, 259-264.
Examples
had_goethals_base(12)
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
# [1,] 1 1 1 1 1 -1 1 -1 -1 -1 1 -1
# [2,] 1 1 1 1 -1 1 -1 -1 1 1 -1 -1
# [3,] 1 1 1 -1 1 1 -1 1 -1 -1 -1 1
# [4,] -1 -1 1 1 1 1 1 -1 -1 1 -1 1
# [5,] -1 1 -1 1 1 1 -1 -1 1 -1 1 1
# [6,] 1 -1 -1 1 1 1 -1 1 -1 1 1 -1
# [7,] -1 1 1 -1 1 1 1 1 1 1 1 -1
# [8,] 1 1 -1 1 1 -1 1 1 1 1 -1 1
# [9,] 1 -1 1 1 -1 1 1 1 1 -1 1 1
#[10,] 1 -1 1 -1 1 -1 -1 -1 1 1 1 1
#[11,] -1 1 1 1 -1 -1 -1 1 -1 1 1 1
#[12,] 1 1 -1 -1 -1 1 1 -1 -1 1 1 1
had_goethals_base(16)
#NULL
had_kronecker
Description
had_kronecker performs the construction of an Hadamard matrix by kronecker product.
Usage
had_kronecker(n, exponent = NULL)
Arguments
n |
an integer (Expected to be Hadamard Number) |
exponent |
an integer |
Details
This function only applicable when n is the power of 2 and multiple of 4.
If n<-2, returns Hadamard matrix of order 2; if n is not Hadamard number, return NULL.
By default exponent=FALSE; when exponent is unknown it is computed.
If exponent is given use the same
Value
Hadamard Matrix of order n, if n is power of 2, otherwise NULL.
References
Hedayat, A. and Wallis, W.D. (1978). Hadamard Matrices and Their Application.Ann. Stat., 6, 1184-1238.
Sylvester, J.J. (1968). Problem 2511. Math. Questions and solutions, 10, 74.
Examples
had_kronecker(4)
# [,1] [,2] [,3] [,4]
#[1,] 1 1 1 1
#[2,] 1 -1 1 -1
#[3,] 1 1 -1 -1
#[4,] 1 -1 -1 1
had_kronecker(8,3)
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#[1,] 1 1 1 1 1 1 1 1
#[2,] 1 -1 1 -1 1 -1 1 -1
#[3,] 1 1 -1 -1 1 1 -1 -1
#[4,] 1 -1 -1 1 1 -1 -1 1
#[5,] 1 1 1 1 -1 -1 -1 -1
#[6,] 1 -1 1 -1 -1 1 -1 1
#[7,] 1 1 -1 -1 -1 -1 1 1
#[8,] 1 -1 -1 1 -1 1 1 -1
had_kronecker(9)
# NULL
had_miyamoto
Description
had_miyamoto function perform the construction of the Hadamard matrix by using the Miyamoto method
Usage
had_miyamoto(n)
Arguments
n |
integer (order of the matrix) |
Details
If the q=n/4, and q be a prime power and q=1 (mod 4). If there is a exists of Hadamard matrix of order q-1, then there exists an Hadamard matrix of order 4q. If given order is not satisfied it returns NULL.
Value
Hadamard matrix of n
References
Miyamoto, M. (1991). A Construction of Hadamard matrices. J. Math. Phy., 12, 311-320.
Examples
had_miyamoto(20)
had_miyamoto(24) #NULL
had_williamson
Description
had_williamson performs the construction Hadamard matrix from Williamson method by using the williamson sequences.
Usage
had_williamson(x)
Arguments
x |
integer (order of the matrix) |
Details
This function construct Hadamard matrix of given order using williamson sequences. If Williamson sequences of length n,n,n,n are available, Hadamard matrix of order 4n can be constructed. If for given order of Matrix Williamson sequences are not available it retuns NULL.
The Williamson sequences are stored in internal dataset, available for length of seq(1,63, 2) except 15, 35, 47, 53, 59 in the internal table.
Value
Hadamard matrix
Source
The williamson sequences are available in London(2013) and Christos Koukouvinos
References
Williamson, J. (1944). Hadamard determinant theorem and the sum of four squares. Duke. Math. J., 11, 65-81.
Williamson, J. (1947). Note on Hadamard's determnant theorem. Bull. Amer. Math. Soc., 53, 608-613.
London, S. 2013. Constructing New Turyn Type Sequences, T-Sequences and Hadamard Matrices. PhD Thesis, University of Illinois at Chicago, Chicago.
Examples
had_williamson(4)
# [,1] [,2] [,3] [,4]
#[1,] 1 1 1 1
#[2,] -1 1 -1 1
#[3,] -1 1 1 -1
#[4,] -1 -1 1 1
had_williamson(8)
# NULL
is.prime
Description
is.prime check the given number is prime or not
Usage
is.prime(num)
Arguments
num |
integer |
Details
if the given number is divisible any number other than 1 and itself it return NULL. otherwise TRUE.
Value
TRUE or FALSE
Examples
is.prime(3)
#TRUE
is.prime(21)
#FALSE
is.primepower
Description
Checks whether given number is a prime power or not. Note that for a prime number, it would return NULL.
Usage
is.primepower(p)
Arguments
p |
integer |
Details
Returns a and b where p=a^b, otherwise NULL. Uses primeFactors() function of numbers package.
Value
a and b where p=a^b and a is a prime number. Otherwise NULL
Examples
is.primepower(2048)
#2 11
is.primepower(7)
#NULL
is.primepower(100)
#NULL
is_divisible
Description
is_divisible is internal function. Not exported.
Usage
is_divisible(num, divisor)
Arguments
num |
integer |
divisor |
integer |
Details
it returns num/divisor value.
Value
num/divisor
kro_method
Description
kro_method internal function. Not exported.
Usage
kro_method(r)
Arguments
r |
integer (order of the matrix) |
Value
r/2 or NULL.
References
Sylvester, J.J. (1967). Thoughts on orthogonal matrices, simultaneous sign-succession and Tessellated pavements in two or more colours, with applications to Newton's rule, ornamental Tie-work, and the theory of numbers. Phil. Mag.,34, 461-475.
Sylvester, J.J. (1968). Problem 2511. Math. Questions and solutions, 10, 74.
Hedayat, A. and Wallis, W.D. (1978). Hadamard Matrices and Their Application.Ann. Stat., 6, 1184-1238.
kronecker_matrix
Description
kronecker_matrix
Usage
kronecker_matrix(n)
Arguments
n |
integer (order of the matrix) |
Details
This function construct Hadamard matrix by multiple of 2 Hadamard matrix. It Returns the Hadamard Matrix, if it is not possible NULL is returned.
Value
Hadamard matrix of order "n"
References
Sylvester, J.J. (1967). Thoughts on orthogonal matrices, simultaneous sign-succession and Tessellated pavements in two or more colours, with applications to Newton's rule, ornamental Tie-work, and the theory of numbers. Phil. Mag.,34, 461-475.
Sylvester, J.J. (1968). Problem 2511. Math. Questions and solutions, 10, 74.
Hedayat, A. and Wallis, W.D. (1978). Hadamard Matrices and Their Application.Ann. Stat., 6, 1184-1238.
Examples
kronecker_matrix(8)
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#[1,] 1 1 1 1 1 1 1 1
#[2,] 1 -1 1 -1 1 -1 1 -1
#[3,] 1 1 -1 -1 1 1 -1 -1
#[4,] 1 -1 -1 1 1 -1 -1 1
#[5,] 1 1 1 1 -1 -1 -1 -1
#[6,] 1 -1 1 -1 -1 1 -1 1
#[7,] 1 1 -1 -1 -1 -1 1 1
#[8,] 1 -1 -1 1 -1 1 1 -1
kronecker_matrix(12)
#NULL
method1_paleyII
Description
method1_paleyII is internal function not exported.
Usage
method1_paleyII(n)
Arguments
n |
integer |
Details
this function checks q<- (n/2)-1, q is prime number and q = 1(mod 4). if it satisfy it returns q; otherwise returns NULL.
Value
0 or (n/2)-1
References
Paley, R.E.A.C. (1933). On Orthogonal matrices. J. Combin. Theory, A 57(1), 86-108.
method2_paleyII
Description
method2_paleyII is internal function not exported.
Usage
method2_paleyII(n)
Arguments
n |
integer (order of the matrix) |
Details
this function checks q<- (n/4)-1, q is prime number and q = 1(mod 4). if it satisfy it returns q; otherwise returns NULL.
Value
0 or (n/4)-1
References
Paley, R.E.A.C. (1933). On Orthogonal matrices. J. Combin. Theory, A 57(1), 86-108.
miyamotoC
Description
miyamotoC
Usage
miyamotoC(n)
Arguments
n |
integer (order of the matrix) |
Value
q matrix
References
Miyamoto, M. (1991). A Construction of Hadamard matrices. J. Math. Phy., 12, 311-320.
Examples
miyamotoC(20)
# [,1] [,2] [,3] [,4] [,5]
#[1,] 0 1 1 -1 -1
#[2,] 1 0 -1 -1 1
#[3,] 1 -1 0 1 -1
#[4,] -1 -1 1 0 1
#[5,] -1 1 -1 1 0
nextElem
Description
nextElem Generate next element of GF.
Usage
nextElem(p1, MF, p, r)
Arguments
p1 |
integer |
MF |
integer |
p |
integer |
r |
integer |
Value
A vector of order r, the coefficients of elements.
ply1
Description
ply1 -internal function; not exported.
Usage
ply1(q)
Arguments
q |
integer |
Value
Hadamard matrix of order 2(q+1)
References
Paley, R.E.A.C. (1933). On Orthogonal matrices. J. Combin. Theory, A 57(1), 86-108.
ply2
Description
ply2 is internal function and not exported
Usage
ply2(q)
Arguments
q |
integer |
Value
Hadamard matrix of order 4(q+1)
References
Paley, R.E.A.C. (1933). On Orthogonal matrices. J. Combin. Theory, A 57(1), 86-108.
pow
Description
pow functions finds the exponent of 2.
Usage
pow(n)
Arguments
n |
integer |
Details
This function checks the given number is the power of 2 or not If the given number is power of 2 it returns the exponent value; otherwise NULL is returned.
Value
power of 2
Examples
pow(4)
# 2
pow(5)
#NULL
pow(6)
#NULL
qhad2
Description
qhad2 creats the Quadratic residues of the prime number.
Usage
qhad2(p)
Arguments
p |
is the integer |
Details
The given input is prime number it retuns the matrix of order p. if the input is not prime number it returns NULL.
Value
matrix of order p
Examples
qhad2(7)
# [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#[1,] 0 -1 -1 1 -1 1 1
#[2,] 1 0 -1 -1 1 -1 1
#[3,] 1 1 0 -1 -1 1 -1
#[4,] -1 1 1 0 -1 -1 1
#[5,] 1 -1 1 1 0 -1 -1
#[6,] -1 1 -1 1 1 0 -1
#[7,] -1 -1 1 -1 1 1 0
quadprime
Description
quadprime is a internal function not exported.
Usage
quadprime(p)
Arguments
p |
integer |
Details
this function obtain Quadratic residues of GF. It returns squares of odd elements of GF
Value
squres
seq_williamson
Description
seq_williamson performs the selection of Williamson sequences from dataset
Usage
seq_williamson(order)
Arguments
order |
integer |
Details
Create williamson sequences of given order from the internal dataset williamson_sequences
Williamson sequences are available for length of seq(1,63, 2) except 15, 35, 47, 53, 59 in the internal table.
Value
Required Williamson sequences of order
Source
The Base sequences are obtained The Base sequences were obtained from Christos Koukouvinos and London (2013).
References
Williamson, J. (1944). Hadamard determinant theorem and the sum of four squares. Duke. Math. J., 11, 65-81.
Williamson, J. (1947). Note on Hadamard's determnant theorem. Bull. Amer. Math. Soc., 53, 608-613.
London, S. 2013. Constructing New Turyn Type Sequences, T-Sequences and Hadamard Matrices. PhD Thesis, University of Illinois at Chicago, Chicago.
See Also
had_williamson
for Williamson construction method using Williamson sequences.