GithubHelp home page GithubHelp logo

Comments (10)

max-radin avatar max-radin commented on July 20, 2024 1

I'll work on implementing this. I'm new to OpenFermion and would like to get familiar with the code.

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024 1

I had this issue in mind while completing #194 so I did it in a way that made this task easy to incorporate. Basically you just fill in the body of _long_string_init in ops/_symbolic_operator.py. @max-radin, are you okay with doing it this way?

from openfermion.

max-radin avatar max-radin commented on July 20, 2024 1

Yes that makes sense to me. I have written some code for long string initialization in FermionOperator that I can move into _long_string_init.

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024

Great. Keep in mind that the task now is basically to reverse-engineer the __str__ method of SymbolicOperator, which now uses the attributes action and action_string. You may want to take advantage of the method _parse_string. Let me know if you have any questions.

from openfermion.

babbush avatar babbush commented on July 20, 2024

Closed by #201

from openfermion.

babbush avatar babbush commented on July 20, 2024

my_operator = FermionOperator('1.7 [3^ 2] - 8 [4^]')
seems to throw an error whereas
my_operator = FermionOperator('1.7 [3^ 2] + 8 [4^]')
and
my_operator = FermionOperator('1.7 [3^ 2] -8 [4^]')
and
my_operator = FermionOperator('1.7 [3^ 2] + -8 [4^]')
do not. I guess subtraction is not supported as expected? @max-radin can you assist with this?

from openfermion.

babbush avatar babbush commented on July 20, 2024

Also, it seems to always assume numbers are complex, for instance
my_operator = FermionOperator('-1.7 [3^ 2] + 8.0 [4^]') print(my_operator)
returns
(-1.7+0j) [3^ 2] + (8+0j) [4^]

from openfermion.

babbush avatar babbush commented on July 20, 2024

Also, I am not sure how one is supposed to provide complex coefficients.
my_operator = FermionOperator('(2.3 + 1.7j) [3^ 2]')
throws an error.

from openfermion.

max-radin avatar max-radin commented on July 20, 2024

Yes I'll fix these issues shortly. Evidently, the complex initializer does not support white space, so you'd have to write '(2.3+1.7j) [3^ 2]'.

from openfermion.

babbush avatar babbush commented on July 20, 2024

Thanks Max! I think we should try to be flexible with respect to the white space.

from openfermion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.