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

quantumlib / OpenFermion / 567
100%
develop: 100%

Build:
Build:
LAST BUILD BRANCH: prony_estimator
DEFAULT BRANCH: develop
Ran 23 Jan 2018 07:46PM UTC
Jobs 4
Files 83
Run time 34min
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

pending completion
567

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`?

8944 of 8965 relevant lines covered (99.77%)

3.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 567.1 (CC=gcc-4.9 CXX=g++-4.9 PYTHON=2.7) 23 Jan 2018 07:46PM UTC 0
99.72
Travis Job 567.1
2 567.2 (CC=gcc-4.9 CXX=g++-4.9 PYTHON=3.4) 23 Jan 2018 07:46PM UTC 0
99.65
Travis Job 567.2
3 567.3 (CC=gcc-4.9 CXX=g++-4.9 PYTHON=3.5) 23 Jan 2018 07:46PM UTC 0
99.65
Travis Job 567.3
4 567.4 (CC=gcc-4.9 CXX=g++-4.9 PYTHON=3.6) 23 Jan 2018 07:47PM UTC 0
99.73
Travis Job 567.4
Source Files on build 567
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #567
  • 2b22248e on github
  • Prev Build on master (#564)
  • Next Build on master (#574)
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