Comments (5)
What do you mean work with numbers exactly? @kevinsung implemented this so might have some more insights on the design decisions.
from openfermion.
I would like to understand if there is a specific rationale behind the absence of implementations for identity() and operations like add with numbers.
As far as I remember, I don't think there was a specific rationale. Adding those methods simply wasn't deemed important enough at the time, but I think they would be a welcome addition.
from openfermion.
What do you mean work with numbers exactly? @kevinsung implemented this so might have some more insights on the design decisions.
Sorry for the lack of the detail. I meant work with numbers as taking numbers (such as int
, float
and complex
) as an input to the operations like __add__
and __sub__
.
As far as I remember, I don't think there was a specific rationale. Adding those methods simply wasn't deemed important enough at the time, but I think they would be a welcome addition.
Then, I am happy to be assigned for that.
While I work on it, I think there is a bug in __isub__
(here):
def __isub__(self, other):
if not isinstance(other, type(self)):
return NotImplemented
for term, coefficient in other.terms.items():
if term in self.terms:
self.terms[term] -= coefficient
else:
self.terms[term] = coefficient # <- Here, shouldn't it be -coefficient?
return self
Thank you.
from openfermion.
@fdmalone Hi, I want to gently remind you about the pull request. I fixed a bug in the subtraction between two Majorana operators, and updated operation between Majorana operator and numbers. Thank you for your attention.
from openfermion.
my bad. Thanks for the contribution.
from openfermion.
Related Issues (20)
- UHF energy with openfermion HOT 1
- scipy > 1.9.3 breaks QuarticFermionicSimulationGate decompose method. HOT 5
- Incorrect Bounds on Trotter Error
- Incorrect formula to calculate required Trotter steps HOT 1
- Resource estimation code not tested as part of the CI
- Should move to black for formatting.
- Why does MajoranaOperator not subclass SymbolicOperator? HOT 1
- Some inconsistencies in molecular single factorization costings HOT 1
- Inconsistencies in the double factorized chemistry resource estimate costing function
- 91 tests fail HOT 7
- Nightly tests are broken HOT 1
- slight modification to function generate_hamiltonian ?
- QuadraticFermionicSimulationGate tests fail with cirq == 1.3.0 HOT 5
- Hubbard model notebook is flaky
- Trotter evolution time may be off by a factor of 2 HOT 2
- 1 test fails HOT 1
- get_sparse_operator fails on non-simplified QubitOperators
- Bad behavior when working with sympy
- pip installation overwrites module directory HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openfermion.