Git Product home page Git Product logo

drudge's People

Contributors

chenpeizhi avatar gauravharsha avatar tschijnmo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drudge's Issues

`dev0` in release tag name makes installation more difficult

Searching for drudge gives results

$ pip search drudge
drudge (0.1.0.dev0)    - # drudge
drudge_parser (3.0.2)  - Naive parser for the Drudge Report

unfortunately it is not possible to install it

$ pip install drudge
Collecting drudge
  Could not find a version that satisfies the requirement drudge (from versions: )
No matching distribution found for drudge

my environment

$ python --version
Python 3.7.0
$ pip --version
pip 19.0.1 from /Users/username/snakepit/virtualenvs/mypy3.7/lib/python3.7/site-packages/pip (python 3.7)

I suspect it's because there's a dev0 in the release name, could that be the case? If yes would you @tschijnmo consider publishing a new release without dev0 in the tag so that pip can install it?

Double superscripts in Tensor.display() output

When a factor of the amplitude of a term is raised to a power, the LaTeX output given by Tensor.display() contains double superscripts, which cannot be properly displayed in a Jupyter notebook. It seems that this could be fixed by modifying the ScalarLatexPrinter class in report.py.

Improvement: differentiation of drudge expressions

Trying this code:

from sympy import IndexedBase, symbols
from drudge import Range, SpinOneHalfPartHoleDrudge
conf = SparkConf().setAppName('test')                                                                         
ctx =  SparkContext(conf=conf) 
dr = SpinOneHalfPartHoleDrudge(ctx)

i,j,k,m = symbols('i j k m')
p = IndexedBase('p')
q = IndexedBase('q')
r = IndexedBase('r')

aux = Range('Aux')
expr = dr.sum((m, aux), p[i,m] * q[j,m] * r[k,m])
expr.diff(p[i,m])

Get:
('Invalid index', i, 'clashing with existing free symbols')

Is it possible to add a behaviour (may be with a parameter and a list of additional externals), so an additional delta will be inserted, and we will get something like

sum((m,aux),  delta[i,i0] * delta[m0,m] * q[j,m] * r[k,m])

as a result?

Replace Spark with Dask

The current version of Drudge uses Spark (PySpark) for parallelism. Despite the computational speed-up it brings, the dependence on Spark adds an extra layer of complexity for developing, maintaining, and using Drudge. Typically encountered during Drudge development is that the program crashes inside some Spark code while throwing some Scala/Java error message, which is hard to understand for a Python developer. Our current workaround is to use dummy_spark for debugging and pyspark for production. However, this two-step approach turns out to be difficult for large-scale problems. Moreover, a non-Python library complicates the deployment.

An alternative to Spark is the Dask library. Dask is implemented in pure Python and integrates well with other scientific/numeric/HPC Python libraries. It works on single workstations as well as clusters. Having a Dask backend makes it easier to debug and profile Drudge codes without sacrificing performance. For implementation, Dask collections such as dask.bag (as a replacement for Spark RDD) or dask.delayed may be a good place to start.

Gaurav and I have talked about switching from Spark to Dask. We may start experimenting when time allows.

assume_comm is not working properly in GenQuadLatticeDrudge

When an instance of GenQuadLatticeDrudge is initialized with assume_comm=True, the commutator of two vectors in the order tuple will fail to simplify if the commutation is not specified in comms. The program will abort in Line 411 of genquad.py. I think the bug lies in Line 394 of genquad.py, where comm need to be assigned a list of terms rather than a Sympy integer. I'll try to fix it.

function `aggregate` NotImplementedError

When I tried to run the following simple script by python xxx.py for sanity check

from pyspark import SparkContext
from drudge import PartHoleDrudge

ctx = SparkContext()
dr = PartHoleDrudge(ctx)

which is taken from the conf_ph.py from the tutorial. I got error msg:

Traceback (most recent call last):
  File "test.py", line 5, in <module>
    dr = PartHoleDrudge(ctx)
  File "/Users/hzye/local/opt/miniconda/envs/frank/lib/python3.6/site-packages/drudge-0.10.0.dev0-py3.6-macosx-10.7-x86_64.egg/drudge/fock.py", line 816, in __init__
    **kwargs)
  File "/Users/hzye/local/opt/miniconda/envs/frank/lib/python3.6/site-packages/drudge-0.10.0.dev0-py3.6-macosx-10.7-x86_64.egg/drudge/fock.py", line 750, in __init__
    orig_ham = (one_body_ham + two_body_ham).reset_dumms()
  File "/Users/hzye/local/opt/miniconda/envs/frank/lib/python3.6/site-packages/drudge-0.10.0.dev0-py3.6-macosx-10.7-x86_64.egg/drudge/drudge.py", line 417, in reset_dumms
    free_vars = self.free_vars
  File "/Users/hzye/local/opt/miniconda/envs/frank/lib/python3.6/site-packages/drudge-0.10.0.dev0-py3.6-macosx-10.7-x86_64.egg/drudge/drudge.py", line 211, in free_vars
    self._free_vars = self._get_free_vars(self._terms)
  File "/Users/hzye/local/opt/miniconda/envs/frank/lib/python3.6/site-packages/drudge-0.10.0.dev0-py3.6-macosx-10.7-x86_64.egg/drudge/drudge.py", line 224, in _get_free_vars
    ).aggregate(set(), _union, _union)
  File "/Users/hzye/local/opt/miniconda/envs/frank/lib/python3.6/site-packages/dummy_spark/rdd.py", line 304, in aggregate
    raise NotImplementedError
NotImplementedError

I checked the source code rdd.py from dummy_spark, and it seems that the function aggregate is indeed not implemented therein but being called by drudge.py. Does anyone know how this could be resolved?

Thanks in advance!

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.