Example #1
0
 def hamiltonian(self, problem, quantum_numbers):
     """
     Given a spherically symmetric problem and quantum numbers,
     generates a Hamiltonian matrix in the momentum (k) basis.
     """
     points, weights = self.contour
     def H_func(i, j):
         return self.H_element(
             points[i], points[j], weights[i], weights[j], 
             problem.mass, problem.potential, quantum_numbers
         )
     return matrix_from_function(H_func, order=len(points), symmetric=True)
Example #2
0
 def hamiltonian(self, problem, Q):
     """
     Given a spherically symmetric problem and quantum numbers,
     generates a Hamiltonian matrix in the Spherical Harmonic 
     Oscillator basis.
     """
     nu = self.mass * self.omega / 2
     R_nls = [self.gen_R_nl(n, Q.l, nu) 
              for n in xrange(self.basis_state_count)]
     def H_func(i, j):
         return self.H_element(i, j, problem.potential, 
                               problem.HO_omega, Q, R_nls)
     return matrix_from_function(H_func, self.basis_state_count, 
                                 hermitian=True)
Example #3
0
    def hamiltonian(self, problem, Q):
        """
        Given a spherically symmetric problem and quantum numbers,
        generates a Hamiltonian matrix in the Spherical Harmonic 
        Oscillator basis.
        """
        nu = self.mass * self.omega / 2
        R_nls = [
            self.gen_R_nl(n, Q.l, nu) for n in xrange(self.basis_state_count)
        ]

        def H_func(i, j):
            return self.H_element(i, j, problem.potential, problem.HO_omega, Q,
                                  R_nls)

        return matrix_from_function(H_func,
                                    self.basis_state_count,
                                    hermitian=True)