Example #1
0
 def quda(self):
     if self._solver is None:
         self._solver = make_shared(
             lib.Solver.create(
                 self._params,
                 self.mat.quda,
                 self.mat_sloppy.quda,
                 self.mat_precon.quda,
                 self.mat_eig.quda,
                 self.profiler.quda,
             ))
     return self._solver
Example #2
0
    def extended_field(self, sites=1):
        if sites in (None, 0) or self.comm is None:
            return self.quda_field

        if isinstance(sites, int):
            sites = [sites] * self.ndims

        # self.check_shape(sites)
        sites = [
            site if dim > 1 else 0 for site, dim in zip(sites, self.comm.dims)
        ]
        if sites == [0, 0, 0, 0]:
            return self.quda_field

        return make_shared(
            lib.createExtendedGauge(
                self.quda_field,
                numpy.array(sites, dtype="int32"),
                default_profiler().quda,
            ))
Example #3
0
 def quda_field(self):
     "Returns and instance of quda::GaugeField"
     self.activate()
     return make_shared(lib.GaugeField.Create(self.quda_params))
Example #4
0
 def quda_field(self):
     "Returns and instance of quda::ColorSpinorField"
     self.activate()
     return make_shared(lib.ColorSpinorField.Create(self.quda_params))
Example #5
0
 def quda_dirac(self):
     return make_shared(lib.Dirac.create(self.quda_params))