NEST Example Networks

Microcircuit Example

Hendrik Rothe, Hannah Bos, Sacha van Albada


This is a PyNEST implementation of the microcircuit model by Potjans and

  • This example contains several files:

    • Helper functions for the simulation and evaluation of the microcircuit.

    • Gathers all parameters and connects the different nodes with each other.

    • Contains the parameters for the network.

    • Contains the simulation parameters.

    • Contains the parameters for the stimuli.

    • Use this script to try out the microcircuit.

How to use the Microcircuit model example:

To run the microcircuit on a local machine, we have to first check that the variables N_scaling and K_scaling in are set to 0.1. N_scaling adjusts the number of neurons and K_scaling adjusts the number of connections to be simulated. The full network can be run by adjusting these values to 1. If this is done, the option to print the time progress should be set to False in the file For running, use python The output will be saved in the directory data.

The code can be parallelized using OpenMP and MPI, if NEST has been built with these applications (Parallel computing with NEST). The number of threads (per MPI process) can be chosen by adjusting local_num_threads in The number of MPI processes can be set by choosing a reasonable value for num_mpi_prc and then running the script with the following command.

mpirun -n num_mpi_prc python

The default version of the simulation uses Poissonian input, which is defined in the file to excite neuronal populations of the microcircuit. If no Poissonian input is provided, DC input is calculated, which should approximately compensate the Poissonian input. It is also possible to add thalamic stimulation to the microcircuit or drive it with constant DC input. This can be defined in the file

MUSIC example


  • MUSIC 1.1.15 or higher

  • NEST 2.14.0 or higher compiled with MPI and MUSIC

  • NumPy


This example runs 2 NEST instances and one receiver instance. Neurons on the NEST instances are observed by the music_cont_out_proxy and their values are forwarded through MUSIC to the receiver.

mpiexec -np 3 music