I know some ways to compute this, but I wonder who has the best current implementation? This would just be a tool for methods development testing rather than for doing anything practical, for example it wouldn’t estimate anything and it wouldn’t need to know anything about biology.

# Fast log likelihood given a fixed alignment, fixed tree, and fixed huge arbitrary sparse transition rate matrix

**rob_lanfear**#2

PyCogent might be worth a look. Very flexible likelihood calculation implementation, and some very nice optimisation routines too (the hard stuff is in C). All very customisable to give you the full range of options from quick to thorough.

**arambaut**#3

BEAGLE library - https://code.google.com/p/beagle-lib/ - is a fast library for computing these likelihoods. It can use GPUs to parallelize the computation of large state space transition probability matrices but it depends on what you mean by ‘huge’.

There are some example programs showing how to call the library and some Python wrappers in the examples folder.