Finding the n th term in Fibonacci series
The code looks fine to me apart from the fact that it can throw an exception. The function fib() powLF() are giving you the complexity of O(log(n)) plus the execution time of the function sum_digits() is 479 ns per loop which is perfectly fine.

&gt; %timeit sum_digits(n)
1000000 loops, best of 3: 479 ns per loop


Take a look at Lecture 3 of the MIT Open Courseware course on algorithms for a good analysis of the matrix approach.

&gt;&gt;&gt; timeit.timeit('fib(1000)', 'from __main__ import fibM as fib', number=10000)
0.40711593627929688
&gt;&gt;&gt; timeit.timeit('fib(1000)', 'from __main__ import fibL as fib', number=10000)
0.20211100578308105