Using zheev subroutine

Open discussion regarding features, bugs, issues, vendors, etc.

Using zheev subroutine

Postby jivifair » Mon Aug 20, 2012 7:31 pm

Hi everyone,

I'm using the subroutine zheev to diagonalize a complex hamiltonian matrix.
Here is my problem, if I grow the dimension of my matrix (say dim= dim+100)
I get an error message like this:

On entry to ZHEEV parameter number 8 had an illegal value

If I only use the non-aumented job ( equal to dim ), the task is accomplished
in a good way.
I don't know how to fix this bug, I think it is because one has to initialize the subroutine

lwork= -1_i4
Call ZHEEV( 'V', 'L', dimen, matrix, dimen, wr, work, lwork, rwork, info ),

but I don't know how to improve the subroutine to do huge dimensional hamiltonian matrix


Adrian O.
Posts: 1
Joined: Mon Aug 20, 2012 7:18 pm

Re: Using zheev subroutine

Postby Julien Langou » Tue Aug 21, 2012 1:39 am

You need to perform a workspace query to know the size of WORK needed by ZHEEV to work properly.
You first need to set LWORK to -1, and call ZHEEV. (WORK needs to be of size at least 1.) This activates a workspace query
and the value for the size of the workspace is returned in WORK(1). Then you set LWORK = WORK(1). Then you DEALLOCATE WORK.
Then you reALLOCATE work of size LWORK. Then you call again the routine ZHEEV and this times the computation should occur. To repeat, at the second call,
WORK should be of the correct size (so you need to allocate WORK) and LWORK needs to be an INTEGER of this dimension as well.
Look for "workspace query" in this forum for more hints.
Julien Langou
Posts: 812
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Return to User Discussion

Who is online

Users browsing this forum: Bing [Bot], Ronaldlax and 20 guests