{ "info": { "author": "Jonah Bernhard", "author_email": "jonah.bernhard@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering :: Physics" ], "description": "freestream\n==========\n*Free streaming and Landau matching for boost-invariant hydrodynamic initial conditions.*\n\n.. image:: https://thumbs.gfycat.com/AffectionateQuerulousAfricanwilddog-size_restricted.gif\n :target: http://gfycat.com/AffectionateQuerulousAfricanwilddog\n\n|\n\n``freestream`` is a Python implementation of pre-equilibrium free streaming for heavy-ion collisions, as described in\n\n- J. Liu, C. Shen, U. Heinz,\n \"Pre-equilibrium evolution effects on heavy-ion collision observables\",\n `PRC 91 064906 (2015) `_,\n `arXiv:1504.02160 [nucl-th] `_.\n- W. Broniowski, W. Florkowski, M. Chojnacki, A. Kisiel,\n \"Free-streaming approximation in early dynamics of relativistic heavy-ion collisions\",\n `PRC 80 034902 (2009) `_,\n `arXiv:0812.3393 [nucl-th] `_.\n\nInstallation\n------------\nSimply run ::\n\n pip install freestream\n\nThe only requirements are numpy (1.8.0 or later) and scipy (0.14.0 or later).\n\nUsage\n-----\n``freestream`` has an object-oriented interface through the ``FreeStreamer`` class, which takes three parameters:\n\n.. code-block:: python\n\n freestream.FreeStreamer(initial, grid_max, time)\n\nwhere\n\n- ``initial`` is a square array containing the initial state,\n- ``grid_max`` is the *x* and *y* maximum of the grid in fm, i.e. half the grid width (see following example),\n- ``time`` is the time to free stream in fm/c.\n\nThe ``initial`` array must contain a two-dimensional (boost-invariant) initial condition discretized onto a uniform square grid.\nIt is then interpreted as a density profile of non-interacting massless partons at time *\u03c4* = 0+.\n\nThe ``grid_max`` parameter sets the outermost *edge* of the grid, *not* the midpoint of the outer grid cell, e.g.\n\n- A 200 \u00d7 200 grid with a max of 10.0 fm has cell edges at -10.00, -9.90, ..., +10.00 and cell midpoints at -9.95, -9.85, ..., +9.95.\n- A 201 \u00d7 201 grid with a max of 10.05 fm has cell edges at -10.05, -9.95, ..., +10.05 and cell midpoints at -10.00, -9.90, ..., +10.00.\n\nThis is the same definition as the `trento `_ ``--grid-max`` parameter.\n\n**It is very important that the grid max is set correctly to avoid superluminal propagation.**\n\nSuppose ``initial`` is an *n* \u00d7 *n* initial condition array with a grid max of 10.0 fm and we want to free stream for 1.0 fm.\nWe first create a ``FreeStreamer`` object:\n\n.. code-block:: python\n\n import freestream\n\n fs = freestream.FreeStreamer(initial, 10.0, 1.0)\n\nWe can now extract the various quantities needed to initialize hydro from ``fs``.\n\nEnergy-momentum tensor *T*\\ :sup:`\u03bc\u03bd`\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.. code-block:: python\n\n Tuv = fs.Tuv()\n\n``Tuv`` is an *n* \u00d7 *n* \u00d7 3 \u00d7 3 array containing the full tensor at each grid point.\nIf we only want a certain component of the tensor, we can pass indices to the function:\n\n.. code-block:: python\n\n T00 = fs.Tuv(0, 0)\n\n``T00`` is an *n* \u00d7 *n* array containing *T*\\ :sup:`00` at each grid point.\nThis is purely for syntactic convenience: ``fs.Tuv(0, 0)`` is equivalent to ``fs.Tuv()[:, :, 0, 0]``.\n\nEnergy density *e* and flow velocity *u*\\ :sup:`\u03bc`\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.. code-block:: python\n\n e = fs.energy_density() # n x n\n u = fs.flow_velocity() # n x n x 3\n\nWe can also extract the individual components of flow velocity:\n\n.. code-block:: python\n\n u1 = fs.flow_velocity(1) # n x n\n\nAgain, this is equivalent to ``fs.flow_velocity()[:, :, 1]``.\n\nShear tensor \u03c0\\ :sup:`\u03bc\u03bd` and bulk pressure \u03a0\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nThe shear pressure tensor \u03c0\\ :sup:`\u03bc\u03bd` works just like *T*\\ :sup:`\u03bc\u03bd`:\n\n.. code-block:: python\n\n pi = fs.shear_tensor() # n x n x 3 x 3\n pi01 = fs.shear_tensor(0, 1) # n x n\n\nThe bulk viscous pressure \u03a0 depends on the equation of state *P(e)*.\nBy default, the ideal EoS *P(e)* = *e*/3 is used:\n\n.. code-block:: python\n\n bulk = fs.bulk_pressure()\n\nThe bulk pressure is in fact zero with the ideal EoS, but there will be small nonzero values due to numerical precision.\n\nTo use another EoS, pass a callable object to ``bulk_pressure()``:\n\n.. code-block:: python\n\n bulk = fs.bulk_pressure(eos)\n\nFor example, suppose we have a table of pressure and energy density we want to interpolate.\nWe can use ``scipy.interpolate`` to construct a spline and pass it to ``bulk_pressure()``:\n\n.. code-block:: python\n\n import scipy.interpolate as interp\n\n eos_spline = interp.InterpolatedUnivariateSpline(energy_density, pressure)\n bulk = fs.bulk_pressure(eos_spline)\n\nOther notes\n~~~~~~~~~~~\nThe code should run in a few seconds, depending on the grid size.\nComputation time is proportional to the number of grid cells (i.e. *n*\\ :sup:`2`).\n\nEnsure that the grid is large enough to accommodate radial expansion.\nThe code does not check for overflow.\n\n``FreeStreamer`` returns references to its internal arrays, so do not modify them in place\u2014make copies!\n\nTesting and internals\n---------------------\n``FreeStreamer`` uses a two-dimensional cubic spline (`scipy.interpolate.RectBivariateSpline `_) to construct a continuous initial condition profile from a discrete grid.\nThis is very precise provided the grid spacing is small enough.\nThe spline sometimes goes very slightly negative around sharp boundaries; ``FreeStreamer`` coerces these negative values to zero.\n\nThe script ``test.py`` contains unit tests and generates visualizations for qualitative inspection.\nTo run the tests, install nose and run::\n\n nosetests -v test.py\n\nThere are two unit tests:\n\n- Comparison against an analytic solution for a symmetric Gaussian initial state (computed in Mathematica).\n- Comparison against a randomly-generated initial condition without interpolation.\n\nThese tests occasionally fail since there is a random component and the tolerance is somewhat stringent (every grid point must agree within 0.1%).\nWhen a test fails, it will print out a list of ratios (observed/expected).\nTypically the failures occur at the outermost grid cell where the system is very dilute, and even there it will only miss by ~0.2%.\n\nTo generate visualizations, execute ``test.py`` as a script with two arguments, the test case to visualize and a PDF output file.\nThere are three test cases:\n\n- ``gaussian1``, a narrow symmetric Gaussian centered at the origin.\n- ``gaussian2``, a wider asymmetric Gaussian offset from the origin.\n- ``random``, a randomly-generated initial condition (this is not in any way realistic, it's only for visualization).\n\nFor example::\n\n python test.py gaussian1 freestream.pdf\n\nwill run the ``gaussian1`` test case and save results in ``freestream.pdf``.\nThe PDF contains visualizations of the initial state and everything that ``FreeStreamer`` computes.\nIn each visualization, red colors indicate positive values, blue means negative, and the maximum absolute value of the array is annotated in the upper left.\n\nAnimations\n----------\nThe included script ``animate.py`` generates animations (like the one at the top of this page) from initial conditions saved in HDF5 format (e.g. `trento `_ events).\nIt requires python3 with matplotlib and h5py, and of course ``freestream`` must be installed.\nTo animate a trento event, first generate some events in HDF5 format then run the script::\n\n trento Pb Pb 10 -o events.hdf\n ./animate.py events.hdf event_0 freestream.mp4\n\nThe first argument is the HDF5 filename, the second is the dataset to animate, and the last is the animation filename.\nRun ``./animate.py --help`` for more information including options for the animation duration, framerate, colormap, etc.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Duke-QCD/freestream", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "freestream", "package_url": "https://pypi.org/project/freestream/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/freestream/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Duke-QCD/freestream" }, "release_url": "https://pypi.org/project/freestream/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "Free streaming for heavy-ion collision initial conditions.", "version": "1.0.1" }, "last_serial": 2298692, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "bc16661c252883650231070125f73d8f", "sha256": "05049d5475984d662cfc0f49d3a6bc347af03b65ebe5eb139e854bb71c5f82f9" }, "downloads": -1, "filename": "freestream-1.0.0.tar.gz", "has_sig": false, "md5_digest": "bc16661c252883650231070125f73d8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9099, "upload_time": "2015-11-30T22:24:01", "url": "https://files.pythonhosted.org/packages/47/2d/eda4ee71fbe24d8be96cd51b6b8e91ab01e4a592c49cc84d946e2cfdd6f7/freestream-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "1a257aa6274a57fe07c87b56bc7e3bc8", "sha256": "e739582d74dd377b2495af494bbfddbeaf0005d88a805e51e2fc0fbdcaaae290" }, "downloads": -1, "filename": "freestream-1.0.1.tar.gz", "has_sig": false, "md5_digest": "1a257aa6274a57fe07c87b56bc7e3bc8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10256, "upload_time": "2016-08-23T19:14:35", "url": "https://files.pythonhosted.org/packages/f8/6a/01e42058e4c86832a1b86c1a7b045f17ef01f55cd08b76f70628ebab9f54/freestream-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1a257aa6274a57fe07c87b56bc7e3bc8", "sha256": "e739582d74dd377b2495af494bbfddbeaf0005d88a805e51e2fc0fbdcaaae290" }, "downloads": -1, "filename": "freestream-1.0.1.tar.gz", "has_sig": false, "md5_digest": "1a257aa6274a57fe07c87b56bc7e3bc8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10256, "upload_time": "2016-08-23T19:14:35", "url": "https://files.pythonhosted.org/packages/f8/6a/01e42058e4c86832a1b86c1a7b045f17ef01f55cd08b76f70628ebab9f54/freestream-1.0.1.tar.gz" } ] }