• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

quantumlib / OpenFermion / 567 / 3
100%
develop: 100%

Build:
Build:
LAST BUILD BRANCH: prony_estimator
DEFAULT BRANCH: develop
Ran 23 Jan 2018 07:46PM UTC
Files 83
Run time 33min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Jan 2018 07:38PM UTC coverage: 99.654% (+0.003%) from 99.651%
CC=gcc-4.9 CXX=g++-4.9 PYTHON=3.5

push

travis-ci

babbush
Implementation of Sz, S-, S+, S^{2} fermion ops (#179)

* Implementation of Sz, S-, S+, S^{2} fermion ops

Implented these useful observables at the level of fermion operators.
That way they can be transformed into the qubit representation by an
arbitrary fermion-to-qubit transform.

Unlike the previously implemented number operator these spin operators
require knowledge of the fermionic modes corresponding to spin-up or
spin-down.  As a first pass I have assumed a number occupation vector
corresponding to spin-less fermions where the even-odd pairs correspond
to a single spatial orbital (or site). This assumption is listed in the
warning of the docstring.  Generalizing to arbitrarying ordering of
alpha, beta spin-orbital sets would require the user to input these sets
when calling these functions.

Test implementations:

Implemented according to the style of the other tests.  But, further
accuracy tests can be included by first performing JW transform,
tensoring up, and then looking at the diagonal elements.  These elements
will correspond to the expected value of the operator for the bitstring.
For example, sz op diagonal elements should give [0, 0.5, -0.5, 0] with
the given orbital order convention.

* improved fermionic spin-operators

Allows for different spin-up/down maps.  Default is canonical order of
even sites in the occupation number vector being alpha spins and odd
sites being beta spins.

Also moved the `up_index` and `down_index` into `_fermion_ops.py`

* moved fermion spin generators under hamiltonians

The only place to move the spin-generators is under the hamiltonians
package.  If moved to utils there is a cyclic import because `up_index`
and `down_index` will be used by `hamiltonians._hubabrd.py` and
`hamiltonians._mean_field_dwave.py`.

Maybe the `hamiltonians` package is a batter place for it since these
spin operators are technically fermionic Hamiltonians correspond to an
observable one likely wants to measure.

* renamed module to `_spin_operators.py`

reducing verbosity

* such a rename

Is this name better than `_angular_momentum_generators`?

8934 of 8965 relevant lines covered (99.65%)

1.0 hits per line

Source Files on job 567.3 (CC=gcc-4.9 CXX=g++-4.9 PYTHON=3.5)
  • Tree
  • List 0
  • Changed 4
  • Source Changed 4
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 567
  • Travis Job 567.3
  • 2b22248e on github
  • Prev Job for CC=gcc-4.9 CXX=g++-4.9 PYTHON=3.5 on master (#564.3)
  • Next Job for CC=gcc-4.9 CXX=g++-4.9 PYTHON=3.5 on master (#574.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc