babbush / HistoricalFermiLib

This is repo where we developed FermiLib, which then became OpenFermion
Apache License 2.0
1 stars 0 forks source link

ProjectQ emulator/compiler recognition of QubitTerm/Operator #19

Closed babbush closed 7 years ago

babbush commented 7 years ago

We need a class in ProjectQ which can directly apply the ProjectQ implementation of QubitOperator to a state vector. This will enable use to quickly simulate circuits or get the lowest eigenvalues of QubitOperators.

thomashaener commented 7 years ago

I implemented the emulation feature for QubitTerm, allowing to apply an n-qubit Pauli gate and thus also time evolution via the decomposition cos(theta)*Id + sin(theta)*pauli_term. The problem is that applying such a large gate is slower than performing individual gates. So the first version will simply compile & simulate QubitTerms instead (Damian is working on that).

I still think the emulation feature for QubitOperator makes sense, so implementing some nice expmv is next.

babbush commented 7 years ago

Great, thanks Thomas. I think this is to be expected. Was your emulation feature in C++ or python?

thomashaener commented 7 years ago

In C++ and it actually depends very much on the number of pauli gates. When applying only a few pauli gates at once, there's at most a 2x speedup -- but this speedup we also get from the simulator right away when we enable gate fusion. So there's no point in having a specialized emulation implementation for terms.