Can you look to see what type of sparse matrix e return in the SHO stuff?
 Let's do whatever you did there.


On Sat, Mar 23, 2013 at 12:29 AM, ottersmh <notifications@github.com> wrote:

> In sympy/physics/quantum/mappinggate.py:
>
> > +        return self._represent_ZGate(None, **options)
> > +
> > +    def _represent_ZGate(self, basis, **options):
> > +        format = options.get('format','sympy')
> > +        matrix = matrix_eye(2**self.nqubits, **options)
> > +        for i, f in self.mapping.items():
> > +            col = IntQubit(i).as_int()
> > +            terms = split_qexpr_parts(f)
> > +            if len(terms[1]) == 0:
> > +                row = IntQubit(*terms[0]).as_int()
> > +                scalar = Integer(1)
> > +            else:
> > +                row = IntQubit(*terms[1]).as_int()
> > +                scalar = Mul(*terms[0])
> > +            if format == 'scipy.sparse':
> > +                matrix = matrix.tolil()
>
> It is originally a dia_matrix and I believe we decided to convert it to a
> LIL matrix to build it. I am not sure if we decided to then change it to
> CSR or just leave it in LIL.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/sympy/sympy/pull/1872/files#r3500652>
> .
>



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com