We have added a Gram-Schmidt orthogonalization feature as per issue 178.

There are however some discussions about the way dependent vectors should be handled.

1- the method implemented initially was to throw an exception if input vectors are not independent
2- the Wolfram API generates zero-vectors when dependent vectors appear, hence ensuring the number of ouput vectors is the same as the number of input vectors, but dropping the constraint of an orthonormal basis
3 - another choice could be to ignore dependent vectors and to generate a base with the number of vectors matching the dimension of the span

Option 1 could be combined with either option 2 or 3 by using a flag that the user could flip to select either to throw an exception or fallback to return a basis. Options 2 and 3 seem incompatible to each other.

Could users look at the discussion in the issue and tell which option they prefer?

I’m sure the answer depends on the use case and I’m not sure what the use case is. Reading [1] it seems that including zeros in the output makes it straightforward to form the pseudo-inverse and QR decomposition from the result.

Once either 2 or 3 is implemented it seems straightforward to create the other by adding or removing zero vectors. Perhaps both is an option?

Fine. I’ll do that, using an enumerate for the flag instead of a boolean. It will even be more clear for users. The enumerate will be something like: DependentVectorsHandling.GENERATE_EXCEPTION, DependentVectorsHandling.ADD_ZERO_VECTOR, DependentVectorsHandling.REDUCE_BASE_TO_SPAN.