Giter Club home page Giter Club logo

Comments (6)

lkwagner avatar lkwagner commented on September 4, 2024

Actually this is basically done. The only thing is that some of our objects are not perfectly picklable due to some lambda functions. So if that could be cleaned up then it would just work.

from pyqmc.

willwheelera avatar willwheelera commented on September 4, 2024

ok great, I can go through and change the lambda functions. By "done", do you mean there's a built-in python object that we can use as the "client" in our current structure? Like client=ThreadPoolExecutor(max_workers=2)?

from pyqmc.

lkwagner avatar lkwagner commented on September 4, 2024

yeah you can use an executor for the client, at least in principle.

from pyqmc.

lkwagner avatar lkwagner commented on September 4, 2024

I think this will not work unless we remove the lambda function definitions from the objects: Some are overused; for example, there is a lot of repeated code in this get_wrapphase business.

../pyqmc/ewald.py:        self.ee_const = lambda ne: ne * (ne - 1) / 2 * ijconst + ne * squareconst
../pyqmc/ewald.py:        self.ei_const = lambda ne: -ne * i_sum * ijconst
../pyqmc/ewald.py:        self.e_single = lambda ne: (ne - 1) * ijconst - i_sum * ijconst + squareconst
../pyqmc/ewald.py:        rs = lambda ne: (3 / (4 * np.pi) / (ne * cellvolume)) ** (1 / 3)
../pyqmc/ewald.py:        xc_correction = lambda ne: cexc / rs(ne)
../pyqmc/jastrowspin.py:        a_value = list(map(lambda x: x.value(rvec, r), self.a_basis))
../pyqmc/jastrowspin.py:        b_value = list(map(lambda x: x.value(rvec, r), self.b_basis[1:]))
../pyqmc/multislater.py:        self.get_phase = (lambda x: x / np.abs(x)) if self.iscomplex else np.sign
../pyqmc/multislaterpbc.py:            self.get_phase = lambda x: x / np.abs(x)
../pyqmc/multislaterpbc.py:            self.get_wrapphase = lambda x: np.exp(1j * x)
../pyqmc/multislaterpbc.py:            self.get_wrapphase = lambda x: (-1) ** np.round(x / np.pi)
../pyqmc/obdm.py:                self.get_wrapphase = lambda x: np.exp(1j * x)
../pyqmc/obdm.py:                self.get_wrapphase = lambda x: (-1) ** np.round(x / np.pi)
../pyqmc/slater.py:            self.get_phase = lambda x: x / np.abs(x)
../pyqmc/slater.py:            self.get_wrapphase = lambda x: np.exp(1j * x)
../pyqmc/slater.py:            self.get_wrapphase = lambda x: (-1) ** np.round(x / np.pi)

from pyqmc.

willwheelera avatar willwheelera commented on September 4, 2024

yup i've already started a branch to work on cleaning those out. I was having an issue with the ewald test, I'll submit a PR when I get it worked out

from pyqmc.

lkwagner avatar lkwagner commented on September 4, 2024

It looks like the pull request #190 fixed this issue. Marking resolved.

from pyqmc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.