Have you considered using a matrix shell:
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateShell.html
What operations do you need to support besides sparse matrix vector
products?
On 03/31/2014 10:49 AM, Mathis Friesdorf wrote:
Hello everybody,
for my Ph.D. in theoretical quantum mechanics, I am currently trying
to integrate the Schroedinger equation (a linear partial differential
equation). In my field, we are working with so called local spin
chains, which mathematically speaking are described by tensor products
of small vector spaces over several systems (let's say 20). The matrix
corresponding to the differential equation is called Hamiltonian and
can for typical systems be written as a sum over tensor products where
it acts as the identity on most systems. It normally has the form
/\sum Id \otimes Id ... Id \otimes M \otimes Id \otimes .../
where M takes different positions.I know how to explicitly construct
the full matrix and insert it into Petsc, but for the interesting
applications it is too large to be stored in the RAM. I would
therefore like to implement it as a matrix free version.
This should be possible using MatCreateMAIJ() and VecGetArray(), as
the following very useful post points out
http://lists.mcs.anl.gov/pipermail/petsc-users/2011-September/009992.html.
I was wondering whether anybody already made progress with this, as I
am still a bit lost on how to precisely proceed. These systems really
are ubiquitous in theoretical quantum mechanics and I am sure it would
be helpful to quite a lot of people who still shy away a bit from Petsc.
Thanks already for your help and all the best, Mathis
--
Dominic Meiser
Tech-X Corporation
5621 Arapahoe Avenue
Boulder, CO 80303
USA
Telephone: 303-996-2036
Fax: 303-448-7756
www.txcorp.com