CONCEPT (COsmological N-body CodE in PyThon) is a free and open-source simulation code for cosmological structure formation

Overview

CONCEPT

  🚀   Latest release: 1.0.1
  📖   Documentation

Introduction

CONCEPT (COsmological N-body CodE in PyThon) is a free and open-source simulation code for cosmological structure formation. The code should run on any Linux system, from massively parallel computer clusters to laptops. The code is written almost exclusively in Python, but achieves C-like performance through code transformation using a custom transpiler/optimizer and Cython. While highly competitive regarding both performance and accuracy, CONCEPT further strives for ease of use.

CONCEPT is capable of simulating matter particles evolving under self-gravity in an expanding background. It has multiple gravitational solvers to choose from, and has adaptive time integration built in. In addition to particles, the code is further able to evolve fluids at various levels of non-linearity, providing the means for the inclusion of more exotic species such as massive neutrinos, as well as for simulations consistent with general relativistic perturbation theory. Various non-standard species — such as decaying cold dark matter — are fully supported.

CONCEPT comes with a sophisticated initial condition generator built in, and can output snapshots, power spectra and several kinds of renders.

The CLASS code is fully integrated into CONCEPT, supplying the needed information for e.g. initial condition generation and general relativistic corrections.

Code paper

The primary paper on CONCEPT is ‘The cosmological simulation code CONCEPT 1.0’.
Cite this paper if you make use of CONCEPT in a publication.

Getting Started

To get started with CONCEPT, walking through the tutorial is highly recommended. That said, installation can be as simple as

bash <(wget -O- https://raw.githubusercontent.com/jmd-dk/concept/v1.0.1/install)

which installs CONCEPT along with all of its dependencies into a single directory. The installation takes a couple of hours on modern hardware. Should the installation process end prematurely, simply rerun the installation command and it will pick up from where it was.

To run a small sample simulation, navigate to the directory where CONCEPT is installed and invoke

./concept -p param/example_basic -n 2 --local

This will run the simulation defined by the provided example_basic parameter file using 2 processes.

Consult the tutorial and the rest of the documentation for further guidance.

You might also like...
Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Aesara
Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Aesara

PyMC3 is a Python package for Bayesian statistical modeling and Probabilistic Machine Learning focusing on advanced Markov chain Monte Carlo (MCMC) an

Statsmodels: statistical modeling and econometrics in Python

About statsmodels statsmodels is a Python package that provides a complement to scipy for statistical computations including descriptive statistics an

Efficient Python Tricks and Tools for Data Scientists
Efficient Python Tricks and Tools for Data Scientists

Why efficient Python? Because using Python more efficiently will make your code more readable and run more efficiently.

3D visualization of scientific data in Python

Mayavi: 3D visualization of scientific data in Python Mayavi docs: http://docs.enthought.com/mayavi/mayavi/ TVTK docs: http://docs.enthought.com/mayav

Datamol is a python library to work with molecules
Datamol is a python library to work with molecules

Datamol is a python library to work with molecules. It's a layer built on top of RDKit and aims to be as light as possible.

A computer algebra system written in pure Python

SymPy See the AUTHORS file for the list of authors. And many more people helped on the SymPy mailing list, reported bugs, helped organize SymPy's part

PennyLane is a cross-platform Python library for differentiable programming of quantum computers.
PennyLane is a cross-platform Python library for differentiable programming of quantum computers.

PennyLane is a cross-platform Python library for differentiable programming of quantum computers. Train a quantum computer the same way as a neural network.

SCICO is a Python package for solving the inverse problems that arise in scientific imaging applications.

Scientific Computational Imaging COde (SCICO) SCICO is a Python package for solving the inverse problems that arise in scientific imaging applications

Float2Binary - A simple python class which finds the binary representation of a floating-point number.

Float2Binary A simple python class which finds the binary representation of a floating-point number. You can find a class in IEEE754.py file with the

Comments
  • installation removes other packages in the directory

    installation removes other packages in the directory

    Hi Jeppe,

    I tried bash <(wget -O- https://raw.githubusercontent.com/jmd-dk/concept/${concept_version}/install), as a result, it removes other packages in the directory where I tried to install concept, if I didn't do something wrong. I think it is necessary to note that in the documentation.

    Thanks! Zhejie

    opened by zhejieding 6
  • Is the Omega_cdm parameter actually important in the simulation?

    Is the Omega_cdm parameter actually important in the simulation?

    Hi! First of all great program, it was a breeze to install. I have one question/issue I would like to ask regarding the importance of Cosmology parameters in the simulation. I tried changing around Ωcdm, Ωb and H0 to see the variation in the simulation. However, after doing so and saving snapshots at many different times for each simulation I noticed that the simulations are very similar in their renders and even plotting them (using scatter) they are almost the same even with wildly different parameters. Is this expected behavior? For reference here are two screenshots of simulations at a=0.3877 with the first picture as parameters:

    H0 = 67km/(sMpc) Ωcdm = 0.27 Ωb = 0.049

    and the second:

    H0 = 90km/(sMpc) Ωcdm = 0.46 Ωb = 0.049 a_begin = 0.05

    render2D_a=0 387786

    render2D_a=0 3877

    opened by nihargupte-ph 4
  • invalid syntax of render2D

    invalid syntax of render2D

    I made a param file and ran it with concept but it returns me a invalid syntax of render2D like follow: Traceback (most recent call last): File "", line 5, in File "/home/user/test/disk/concept/dep/python/lib/python3.9/ast.py", line 50, in parse return compile(source, filename, mode, flags, File "", line 8 'render2D': a_begin ^ SyntaxError: invalid syntax An error occurred! I learned the tutorial and tired to modify the code but still can't work,and here's my code: initial_conditions = { 'species': 'matter', 'N' : 64**3, }

    output_times = { 'snapshot': a_begin 'render2D': a_begin } output_dirs = { 'snapshot': path.output_dir 'render2D': path.output_dir }

    render2D_select = { 'all': { 'data' : False, 'image' : True, 'terminal image': True, }, }

    snapshot_select = { 'save': { 'matter': { 'pos': True, 'mom': True, 'J' : True, }, }, 'load': { 'matter': { 'pos': True, 'mom': True, 'J' : True, }, }, } snapshot_type = 'concept'

    boxsize = 256*Mpc/h potential_options = 128

    H0 = 67km/(sMpc) Ωb = 0.049 Ωcdm = 0.27 a_begin = 0.02 primordial_spectrum = { 'A_s': 2.1e-9, # Amplitude 'n_s': 0.96, # Tilt / spectral index }

    opened by wuchenglon 2
  • Error when trying to dump 2D render as image but not as terminal image

    Error when trying to dump 2D render as image but not as terminal image

    When run with the following content of the param-file:

    # Non-parameter variable used to control the size of the simulation
    _size = 128
    
    # Input/output
    initial_conditions = {
        'species': 'matter',
        'N'      : _size**3,
    }
    output_dirs = {
        'render2D' : paths['output_dir']
    }
    output_times = {
        'render2D' : logspace(log10(a_begin), log10(1), 100)
    }
    render2D_select = {
        'matter': {'data': False, 'image': True,  'terminal image': False},
    }
    
    # Numerical parameters
    boxsize = 128*Mpc
    
    # Cosmology
    H0      = 67*km/(s*Mpc)
    Ωcdm    = 0.27
    Ωb      = 0.049
    a_begin = 0.02
    
    # Physics
    select_forces = {
        'matter': {'gravity': ('pm', 2*_size)},
    }
    
    # Graphics
    render2D_options = {
        'gridsize': {
            'matter': _size,
        },
        'terminal resolution': {
            'matter': 80,
        },
        'colormap': {
            'matter': 'inferno',
        },
    }
    

    concept produces the following error message instead of rendering the 2D image:

    Traceback (most recent call last):
      File "graphics.pyx", line 568, in graphics.render2D
        BEGIN_UNICODE__DOUBLE__DASH__STRUCK__SPACE__CAPITAL__SPACE__R__END_UNICODE_237__DIV____LTH__double__GTH____OPAR__vmax_terminal__MIN__vmin_terminal__CPAR__ = <double>(237/<double>(vmax_terminal - vmin_terminal))
    UnboundLocalError: local variable 'vmax_terminal' referenced before assignment
    Exception ignored in: 'main.dump'
    Traceback (most recent call last):
      File "graphics.pyx", line 568, in graphics.render2D
        BEGIN_UNICODE__DOUBLE__DASH__STRUCK__SPACE__CAPITAL__SPACE__R__END_UNICODE_237__DIV____LTH__double__GTH____OPAR__vmax_terminal__MIN__vmin_terminal__CPAR__ = <double>(237/<double>(vmax_terminal - vmin_terminal))
    UnboundLocalError: local variable 'vmax_terminal' referenced before assignment
    

    When run with 'terminal image': True it completes successfully.

    bug 
    opened by pcs96 1
Releases(v1.0.1)
Owner
Jeppe Dakin
Postdoctoral Researcher in the field of Cosmology
Jeppe Dakin
3D visualization of scientific data in Python

Mayavi: 3D visualization of scientific data in Python Mayavi docs: http://docs.enthought.com/mayavi/mayavi/ TVTK docs: http://docs.enthought.com/mayav

Enthought, Inc. 1.1k Jan 06, 2023
Statsmodels: statistical modeling and econometrics in Python

About statsmodels statsmodels is a Python package that provides a complement to scipy for statistical computations including descriptive statistics an

statsmodels 8.1k Dec 30, 2022
PennyLane is a cross-platform Python library for differentiable programming of quantum computers.

PennyLane is a cross-platform Python library for differentiable programming of quantum computers. Train a quantum computer the same way as a neural network.

PennyLaneAI 1.6k Jan 04, 2023
CoCalc: Collaborative Calculation in the Cloud

logo CoCalc Collaborative Calculation and Data Science CoCalc is a virtual online workspace for calculations, research, collaboration and authoring do

SageMath, Inc. 1k Dec 29, 2022
A logical, reasonably standardized, but flexible project structure for doing and sharing data science work.

Cookiecutter Data Science A logical, reasonably standardized, but flexible project structure for doing and sharing data science work. Project homepage

6.4k Jan 02, 2023
A computer algebra system written in pure Python

SymPy See the AUTHORS file for the list of authors. And many more people helped on the SymPy mailing list, reported bugs, helped organize SymPy's part

SymPy 9.9k Jan 08, 2023
collection of interesting Computer Science resources

collection of interesting Computer Science resources

Kirill Bobyrev 137 Dec 22, 2022
Metaflow is a human-friendly Python/R library that helps scientists and engineers build and manage real-life data science projects

Metaflow Metaflow is a human-friendly Python/R library that helps scientists and engineers build and manage real-life data science projects. Metaflow

Netflix, Inc. 6.3k Jan 03, 2023
A modular single-molecule analysis interface

MOSAIC: A modular single-molecule analysis interface MOSAIC is a single molecule analysis toolbox that automatically decodes multi-state nanopore data

National Institute of Standards and Technology 35 Dec 13, 2022
OPEM (Open Source PEM Fuel Cell Simulation Tool)

Table of contents What is PEM? Overview Installation Usage Executable Library Telegram Bot Try OPEM in Your Browser! MATLAB Issues & Bug Reports Contr

ECSIM 133 Jan 04, 2023
PsychoPy is an open-source package for creating experiments in behavioral science.

PsychoPy is an open-source package for creating experiments in behavioral science. It aims to provide a single package that is: precise enoug

PsychoPy 1.3k Dec 31, 2022
Mathics is a general-purpose computer algebra system (CAS). It is an open-source alternative to Mathematica

Mathics is a general-purpose computer algebra system (CAS). It is an open-source alternative to Mathematica. It is free both as in "free beer" and as in "freedom".

Mathics 535 Jan 04, 2023
A flexible package manager that supports multiple versions, configurations, platforms, and compilers.

Spack Spack is a multi-platform package manager that builds and installs multiple versions and configurations of software. It works on Linux, macOS, a

Spack 3.1k Dec 31, 2022
Float2Binary - A simple python class which finds the binary representation of a floating-point number.

Float2Binary A simple python class which finds the binary representation of a floating-point number. You can find a class in IEEE754.py file with the

Bora Canbula 3 Dec 14, 2021
Animation engine for explanatory math videos

Manim is an engine for precise programatic animations, designed for creating explanatory math videos. Note, there are two versions of manim. This repo

Grant Sanderson 48.9k Jan 03, 2023
artisan: visual scope for coffee roasters

Artisan Visual scope for coffee roasters WARNING: pre-release builds may not work. Use at your own risk. Summary Artisan is a software that helps coff

Artisan – Visual Scope for Coffee Roasters 705 Jan 05, 2023
Program that estimates antiderivatives utilising Maclaurin series.

AntiderivativeEstimator Program that estimates antiderivatives utilising Maclaurin series. Setup: Needs Python 3 and Git installed and added to PATH.

James Watson 3 Aug 04, 2021
CONCEPT (COsmological N-body CodE in PyThon) is a free and open-source simulation code for cosmological structure formation

CONCEPT (COsmological N-body CodE in PyThon) is a free and open-source simulation code for cosmological structure formation. The code should run on any Linux system, from massively parallel computer

Jeppe Dakin 62 Dec 08, 2022
Zipline, a Pythonic Algorithmic Trading Library

Zipline is a Pythonic algorithmic trading library. It is an event-driven system for backtesting. Zipline is currently used in production as the backte

Quantopian, Inc. 15.7k Jan 07, 2023
Discontinuous Galerkin finite element method (DGFEM) for Maxwell Equations

DGFEM Maxwell Equations Discontinuous Galerkin finite element method (DGFEM) for Maxwell Equations. Work in progress. Currently, the 1D Maxwell equati

Rafael de la Fuente 9 Aug 16, 2022