Construct weighing matrix from given input weighing matrix W(n,p)
This construction generates a weighing matrix W([(p^(m+1)-1)/(p-1)](n-1)+1,p^(m+1)), for given m (m=1 in output below) from an entered weighing matrix W(n,p), p an odd prime, using a method by Hadi Kharaghani, Thomas Pender and Sho Suda which appears in the paper: Balanced weighing matrices, Journal of Combinatorial Theory, Series A, 186 (2022).
Recall that W(n,p) is a weighing matrix if it is a dimension n (0,+1,-1)-matrix with W W^t = pI_n.
The coding for the backend was done by Tom Pender.

Input is a string of these (which get converted to a string of +'s, -'s and 0's):
   1, +, = or p meaning +1
   -1 followed by whitespace, - or m meaning -1
   0 or z meaning 0
For example, +1-10 is ++-+0 while 1 -1 0 or +-0 gives +-0

Hint, try W(8,5):  ++++-000+-+-0-00++--00-0+--+000-+000++++0+00+-+-00+0++--000++--+

 

no matrix given or dimension is less than 3