question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

General methods for second quantized operators

See original GitHub issue

What is the expected enhancement?

There is some general functionality which would be nice to have for all types of second-quantized ops:

  1. Checks for hermiticity of an operator (Is the operator equivalent to its adjoint)?
  2. A direct way to compute commutators, and checks for commutativity.
  3. I think it would be nice to also have a .to_matrix method for the FermionicOp as is already in place for the SpinOp.
  4. For the .to_matrix() methods it would be nice to return a sparse datatype such as one of the scipy.sparse formats like csc. Maybe this could be its own method .to_sparse_matrix().

Points 1. and 2. should be straightforward to implement with the current arithmetics already in place.

For 3. one needs to make a choice whether to use the full Fock space (with varying particle number) as a basis or only a certain particle-number (and fixed spin?) subspace. It might be nice to have this be specified by the user.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
LaurinFischercommented, Oct 31, 2022

Okay so in summary, I think what we want to implement is:

  • Hermiticity checks for all SecondQuantizedOps SecondQuantizedOp.is_hermite() -> bool

  • A way to compute commutators such as commutator(op1: SecondQuantizedOp, op2: SecondQuantizedOp).is_zero()

  • .to_matrix()-method for FermionicOp over the full Fock basis

  • scipy.sparse representations of the matrices for FermionicOp and SpinOp, e.g. with parameter to_matrix(sparse: bool)

After an offline discussion with @ikkoham I think I could take care of these (this would also be a good learning opportunity for me to get into the workflow). Should I open a new issue for each of these points or can we use this issue to keep track of the changes?

2reactions
ikkohamcommented, Apr 15, 2021

Thank you for nice suggestion.

  1. Checks for hermiticity of an operator (Is the operator equivalent to its adjoint)?

SecondQuantizedOp.is_hermite() -> bool is nice!

  1. A direct way to compute commutators, and checks for commutativity.

We have two choices.

  1. SecondQuantizedOp.is_commutative(op: SecondQuantizedOp) -> bool
  2. commutator(op1: SecondQuantizedOp, op2: SecondQuantizedOp).is_zero(). I’ve made this in opflow.
  1. I think it would be nice to also have a .to_matrix method for the FermionicOp as is already in place for the SpinOp.

The basis ofFermionicOp.to_matrix() isn’t trivial as you said. Which basis is convenient for chemistry users?

  1. For the .to_matrix() methods it would be nice to return a sparse datatype such as one of the scipy.sparse formats like csc. Maybe this could be its own method .to_sparse_matrix().

Nice. See https://github.com/Qiskit/qiskit-nature/blob/master/qiskit_nature/operators/second_quantization/spin_op.py#L439. This parameter is same with quantum_info.Pauli.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Second quantization - Wikipedia
Second quantization, also referred to as occupation number representation, is a formalism used to describe and analyze quantum many-body systems.
Read more >
“Second quantization” (the occupation-number representation)
The second quantization method involves the use of so-called creation and annihilation oper- ators. These operators respectively create and ...
Read more >
Chapter 2 Second Quantisation - Theory of Condensed Matter
Second quantisation provides a basic and efficient language in which to formulate many- particle systems.
Read more >
Second Quantization
The essential step in the second quanti- zation is the introduction of so-called creation and annihilation operators. By doing this, we eliminate the...
Read more >
Second Quantization
CREATION AND ANNIHILATION OPERATORS IN QUANTUM MECHANICS3 ... We will now discuss a procedure, known as Second Quantization, which will.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found