Brian 2.0 alpha release

We are proud to announce the alpha release of Brian2, the successor of Brian, everyone's favourite neural simulator.

This is an alpha release, therefore many features are still missing and there are very likely many bugs. The main reason for this release is to get feedback from users, the only way to make sure that the final version will be as useful to everyone as possible.

This release is the cumulation of work that started more than one year ago, a basic rewrite of Brian that tries to keep and extend the strengths of Brian (ease of use, flexibility) while building it on a new foundation of a code generation framework that will allow for exciting new applications in the future.

How to get Brian2?

Brian2 is available on the python package index, therefore you can install it using easy_install or pip:

easy_install brian2 pip install --pre brian2

Alternatively, you can directly download the package from the package index and install it yourself using python install (if you are using Python 2, simply running it from the source directory also works).

Finally, you can also clone the git repository at:

Note that the package is called brian2, not brian, therefore it does not interfere with an existing Brian installation and trying out Brian2 will not affect your existing Brian simulations.


You can find documentation for Brian2 at readthedocs:

Note that the user documentation is still quite incomplete, you'll find a lot of information in the reference documentation, though.

Feedback wanted!

This is an alpha release, so there is still a lot that will change in the next months. However, the syntax is already mostly the way we plan it to be. Please provide feedback if you find something unintuitive or you fail to see how to express something that you could express in Brian1. For the feedback, please use either the brian-development mailing list or the github issues. Note that the *internal* code (e.g. the interface to the code generation framework) will still change quite a bit.

Known issues

  • Brian hears and the modelfitting toolbox have not yet been ported to Brian2
  • Brian2 is not yet optimised for performance. In particular, setting up a simulation or using multiple run statements might appear to be slow because a lot of work is unnecessarily repeated. For the simulation itself, a big performance increase can be often achieved by switching on C++ code generation by using the following in the code: = 'weave'
  • When using the ipython notebook, importing brian2 makes a lot of debug outputs appear under certain circumstances (#133)
  • Many error messages are not yet as helpful as they could be
  • Various other known issues can be found in the issue tracker

Brian tutorial at CNS 2013

On July 13th 2013, we'll have a tutorial on "Advanced modelling of spiking neural networks with Brian" at the CNS conference in Paris, covering various topics around the available Brian toolboxes, the ongoing Brian development and general handy tricks to cope with complex simulations. The tutorial will also feature an open questions sessions in the end where attendants can ask for help with individual problems they have in their current Brian project. Follow this link to find the schedule and material.

New book on IPython

Cyrille Rossant, one of the developers of Brian, has written a new book "Learning IPython for Interactive Computing and Data Visualization". Recently, IPython has really become an excellent tool for scientific computation, growing far beyond its roots as an enhanced interactive shell for Python. It now supports the IPython notebook (which lets you mix text, mathematics, code and results, like in Mathematica notebooks), and a parallel computing engine to use multiple cores or machines. Unfortunately, the online documentation is not as easy to follow as it could be, which is where Cyrille's book comes in handy.

He covers everything from installation to advanced topics like high performance computing and customizing IPython, using clear, worked examples with publicly available datasets. In addition to IPython, he also briefly covers using important scientific computing Python packages such as NumPy, SciPy, Cython and Pandas.

And of course, for the next major release of Brian we're working on incorporating lots of support for the IPython workflow.

If you haven't yet tried IPython or if you've only just started using it, I'd highly recommend Cyrille's book (reasonably priced at around $15 for the ebook version). There's even plenty of stuff in there for more experiened users too.

Brian 1.4.1

We have just released Brian 1.4.1, available from PyPI using  pip install -U brian or easy_install -U brian, or from the NeuralEnsemble server. It will be soon available in the NeuroDebian repositories as well, thanks to the NeuroDebian team.

This is a minor release, but it adds a couple of useful features (including experimental features for the Synapses class) and fixes some important bugs, in particular for users of brian hears. A list of changes can be found below:

Major features:

  • C extensions are compiled by default during installation (with a fallback to the Python version if compilation fails) -- this might lead to a considerable speedup for users who did not compile those extensions manually before. Note that this only includes installations based on running (including pip and easy_install), not the Windows .exe installer.
Minor features:
  • Convenience methods for the Synapses class, allowing to save and load the connectivity and to convert the weights into a matrix
  • A new openmp option to switch on the use of OpenMP pragmas in generated C code
  • Brian hears: Two new models, MiddleEar (filtering by the middle ear) and ZhangSynapse (model of the IHC-AN synapse)
  • Brian hears: New convenience functions to get reasonable axis ticks for logarithmic axes
  • Brian's documentation is now also available under
  • ProgressReporter has context manager support (i.e. can be used in "with" statements)
  • NeuronGroup and Synapses work with empty model specifications.
  • C version of SpikeContainer is now picklable
Bug fixes:
  • Synaptic equations referring to variables in the pre- or postsynaptic group are never considered as being linear (fixes ticket #83)
  • Fix issue with static equations in synaptic models (see )
  • Make LinearStateUpdater pickable, even if array B is "NotImplemented".
  • Fixed the bug in which the StateSpikeMonitor didn't record variables defined with a static equation.
  • Important bug fixes for brian hears, all users are encouraged to update:
    • Make sure that LinearFilterbank copies it source and therefore not changes it (when not using weave) (fixes ticket #73)
    • Fix some bugs in the TanCarney model
    •  Fix shifting multi-channel sounds with fractional=True (fixes ticket #80)
Experimental features:
  • C version of SpikeQueue (used in the Synapses class), which can lead to a considerable speedup (see "Advanced concepts/Compiled code" for instructions how to use it).
  • Delays can be specified as a parameters of the Synapses model and then be changed dynamically.

Brian 1.4 is out!

The 1.4 release of Brian is out!

The major change in this version is the addition of a new Synapses class, which allows modeling everything synaptic: gap junctions, probabilistic synapses, nonlinear synapses, plasticity, etc. There are also a number of other new features, bug fixes and improvements (see below).

Brian is being developed by Romain Brette and Dan Goodman. This version also includes contributions by Bertrand Fontaine, Cyrille Rossant, Victor Benichoux, Marcel Stimberg and Jonathan Laudanski.

We take advantage of this announcement to inform Brian users that we are currently discussing the development of Brian 2.0, a rewriting of Brian, intended to be simpler, faster, and to be able to run on external devices (e.g. GPU). We will make an announcement on our mailing list soon, where we will ask for user opinions.

New features since 1.3.1

Major features:

  • New Synapses class (plasticity, gap junctions, nonlinear synapses, etc)
Minor features:
  • New AERSpikeMonitor class
  • Several updates to library.electrophysiology
  • Units should work better with static code analysers now
  • Added Network.remove
  • SpikeMonitor has a new .it attribute (returns pair i, t of arrays of spike times)
  • Many new examples
Bug fixes:
  • Assigning to a static variable (equation) now raise an error
  • Fixed issues for TimedArrays with explicitly set times (fixes ticket #81)
  • Fixed bug, repr and str didn't work for Sound
  • Fixed bug where tone(array_of_frequencies, ...)
  • Fixed SparseConnectionMatrix bug suggested by Owen Mackwood
  • Fixed bug in Parameters reported by Jimmy Bonaiuto
  • Fixed bug with contained_objects reported by Oleg Sinyavskiy
  • Units repr and str fixes
  • Sound.spectrum, Sound.pinknoise, brownnoise
  • t wasn't available in StringReset and PythonThreshold
Deprecated or removed features:
  • MultipleSpikeGeneratorGroup
  • experimental.coincidence_detection
Experimental features:
  • Generating model documentation automatically (experimental.model_documentation)

Better sparse matrix support

We just added a new method Connection.connect_from_sparse(W, delay=None, column_access=True) which allows you to initialise a Connection object directly with any scipy sparse matrix. This has a huge memory efficiency gain if you use CSR/COO matrices, as by default Brian uses LIL which is very flexible but memory inefficient. For an even bigger memory efficiency gain, if you are not using STDP, set column_access=False. Download the SVN version of Brian to start using this feature.

About the new website

The Brian website looks weird! It's not going to last! We have been hacked by some trojan (not the software, just the website) and we had to remove everything. The content is back, but all the settings have gone. It will take a little while to put everything back to the original configuration, please be patient!

Update: it's back to normal!

Brian 1.3.1

We have just released Brian 1.3.1, available via easy_install -U brian or from our download page.

This is a minor release, but there are some nice new features and many small improvements (listed below).

Minor features:

  • New PoissonInput class
  • New auditory model: TanCarney (brian.hears)
  • Many more examples from papers
  • New electrode compensation module (in library.electrophysiology)
  • New trace analysis module (in library.electrophysiology)
  • Added new function to use multiple CPUs to perform multiple runs of a simulation and save results to a DataManager, with an optional GUI interface.
  • Added FractionalDelay filterbank to brian.hears, fractional itds to HeadlessDatabase and fractional shifts to Sound.shifted.
  • Added vowel function to brian.hears for creating artificial vowel sounds
  • New spike_triggered_average function
  • Added maxlevel and atmaxlevel to Sound
  • New IRNS/IRNO noise functions
  • SpikeGeneratorGroup is much faster.
  • Added RemoteControlClient.set(var, name) to allow sending data to the server from the client (previously you could only receive data from the server but not send it, except in string form).
  • Monitors do not process empty spike arrays when there have not been any spikes, increases speed for monitored networks with sparse firing (#78)
  • Various speed optimisations
Bug fixes:
  • Fixed bug with frozen equations and time variable in equations
  • Fixed bug with loading sounds using Sound('filename.wav')
  • SpikeMonitor now clears spiketimes correctly on reinit (#75)
  • MultiConnection now propagates reinit (important for monitors) (#76)
  • Fixed bug in realtime plotting
  • Fixed various bugs in Sound
  • Fixed bugs in STDP
  • Now propagates spikes only if spikes exist (#78)

The Brian Twister

We are organizing a competition, the "Brian twister": write an example script for the Brian simulator and win a Brian mug! A winning entry:

  • is short and self-consistent
  • is easy to read
  • does something cool (e.g. something related to a paper)
For example, this short script simulates a synfire chain (Diesmann et al., 1999):

The goal of this competition is to extend the set of examples provided to Brian users. It is also an opportunity for you to advertise your papers. The examples will be included in the next Brian release.

Please send me your file with a short explanation before the end of this year (31 December 2011):

Good luck!