Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pauli and Fermion operators add Identity offset when there is a leading +/- sign character #547

Open
1tnguyen opened this issue Jul 12, 2022 · 0 comments
Labels

Comments

@1tnguyen
Copy link
Member

Test cases:

  1. Pauli
TEST(PauliOperatorTester, checkLeadingSignCharacter) {
    std::string src = "- 0.5 Z0 Z1 + 1.2 Z1 Z2";
    PauliOperator op(src);
    std::cout << op.toString() << "\n";
}

The printout contains an extra +1 offset: (1,0) + (-0.5,-0) Z0 Z1 + (1.2,0) Z1 Z2

  1. Fermion
TEST(FermionOperatorTester, checkLeadingSignCharacter) {
    std::string src = "+ 0.5 1^ 0 + 1.2 2^ 3";
    FermionOperator op(src);
    std::cout << op.toString() << "\n";
}

The printout contains an extra +1 offset: (1,0) + (0.5,0) 1^ 0 + (1.2,0) 2^ 3

@1tnguyen 1tnguyen added the bug label Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant