Yes. They are called "stack" and "augment" in Sage, and they
should work with any Sage matrix types.
sage: a = random_matrix(ZZ, 2,3); b = random_matrix(ZZ, 2, 3)
sage: a.stack(b)
[-4 20 -4]
[-4 -4 3]
[-1 25 -8]
[ 1 -2 1]
sage: a.augment(b)
[-4 20 -4 -1 25 -8]
[-4 -4 3 1 -2 1]
-- William
There is also the block_matrix command which may also be of interest:
sage: m = matrix(ZZ, 2, 2, 1); m
[1 0]
[0 1]
sage: block_matrix([0,m,m,0])
[0 0|1 0]
[0 0|0 1]
[---+---]
[1 0|0 0]
[0 1|0 0]
sage: block_matrix([m,m], nrows=1)
[1 0|1 0]
[0 1|0 1]
sage: block_matrix([m,m], ncols=1)
[1 0]
[0 1]
[---]
[1 0]
[0 1]
--Mike
They are for me (see attached screen shot where both augment and
stack appear), and I can't think of any conceivable reason why
they wouldn't appear for you. Could you check again and if
they really aren't there let us know, and we can do some things
to debug the problem?
William
I disagree. In fact, most people who use Sage (or Python for that
matter) create an object A of the type they want to do
something with then type A.[tab] and see a list of the
options. One would definitely see "augment" and "stack" among
the 100 or so options, and it's not unlikely they would realize
those functions can be used to augment or stack matrices.
This exactly addresses the problem of there being an easy way to
find functionality, certainly in a better way than it is addressed
in Magma, and it's something a lot of Sage users really appreciate
over other systems.
You could also type
sage: search_src('augment')
and get a list of places in the Sage library where the word augment
appears -- not so easy to use, but potentially very useful.
You can also do:
sage: search_src('victor')
----------------------------------------------------------------------
| SAGE Version 2.10.1, Release Date: 2008-02-02 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
libs/ntl/all.py:Victor Shoup's NTL C++ Library
libs/ntl/all.py:SAGE provides an interface to Victor Shoup's C++ library NTL.
modular/modform/all.py:from vm_basis import victor_miller_basis, delta_qexp
modular/modform/cuspidal_submodule.py: return
vm_basis.victor_miller_basis(self.weight(), prec,
modular/modform/vm_basis.py:The Victor Miller Basis
modular/modform/vm_basis.py:def victor_miller_basis(k, prec=10,
cusp_only=False, var='q'):
modular/modform/vm_basis.py: Compute and return the Victor-Miller basis for
modular/modform/vm_basis.py: sage: victor_miller_basis(1, 6)
modular/modform/vm_basis.py: sage: victor_miller_basis(0, 6)
modular/modform/vm_basis.py: sage: victor_miller_basis(2, 6)
modular/modform/vm_basis.py: sage: victor_miller_basis(4, 6)
modular/modform/vm_basis.py: sage: victor_miller_basis(6, 6, var='w')
modular/modform/vm_basis.py: sage: victor_miller_basis(6, 6)
modular/modform/vm_basis.py: sage: victor_miller_basis(12, 6)
modular/modform/vm_basis.py: sage: victor_miller_basis(12, 6,
cusp_only=True)
modular/modform/vm_basis.py: sage: victor_miller_basis(24, 6,
cusp_only=True)
modular/modform/vm_basis.py: sage: victor_miller_basis(24, 6)
modular/modform/vm_basis.py: sage: victor_miller_basis(32, 6)
matrix/matrix_integer_dense.pyx: ALGORITHM: Uses the NTL
library by Victor Shoup or fpLLL
rings/polynomial/polynomial_element.pyx: ## Victor Schoup was
very careful with the choice of strategies and
William