Skip to content

Commit

Permalink
Add lattice and Fermi-Hubbard model (#365)
Browse files Browse the repository at this point in the history
* add lattice and FermiHubbard

* minor update

* update

* fix lint and refactor

* add unit tests

* update unit tests

* update unit tests

* fix typo of apidocs

* fix docs generation

* minor update

* fix docs

* minor update

* fix lint

* minor update

* updates

* add comments and documentation

* fix spell

* minor update

* Revert unnecessary changes

* improves docs

* dynamical annotations

* add release note

* minor update

* update document

* add DrawStyle

* minor update

* add tutorial

* fix documentation

* minor update

* extract functions

* edit pylintdict

* add BoundaryCondition Enum

* minor change

* delete tutorial

* fix releasenote

* minor update

* fix matplotlib dependency

* fix mypy error

* minor update

* change filepath (lattice -> lattices)

* remove unnecessary return docs

* remove unnecessary setter

* fix copy

* remove unnecessary getter (dim, size, boundary_edges)

* improve typehint by PEP-563

* Revert "improve typehint by PEP-563"

This reverts commit 71d263b.

* fix spells

Co-authored-by: Manoel Marques <[email protected]>
Co-authored-by: ikkoham <[email protected]>
  • Loading branch information
3 people authored Dec 9, 2021
1 parent 714b88b commit 25c72a0
Show file tree
Hide file tree
Showing 26 changed files with 2,151 additions and 3 deletions.
15 changes: 15 additions & 0 deletions .pylintdict
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ ao
april
arginine
args
arrowheads
arrowstyle
arxiv
asparagine
aspartic
Expand Down Expand Up @@ -59,14 +61,17 @@ clbits
clifford
cliffords
cls
cmap
cnot
codec
coeff
coeffs
colormap
commutativities
conda
conf
config
connectionstyle
coord
coords
coul
Expand Down Expand Up @@ -166,6 +171,7 @@ hilbert
histidine
html
https
hubbard
ia
iajb
ifdef
Expand Down Expand Up @@ -219,6 +225,7 @@ libor
libxc
lih
lijh
linewidths
linux
ljik
lk
Expand All @@ -227,6 +234,7 @@ lookback
lysine
macos
makefile
matplotlib
maxdepth
maxiter
maxiters
Expand Down Expand Up @@ -303,6 +311,7 @@ phenylalanine
phonons
polypeptides
popovas
pos
posteriori
pre
prebuilt
Expand Down Expand Up @@ -339,6 +348,9 @@ rebranding
refactor
regs
repr
retworkx
rgb
rgba
rhf
rhs
robert
Expand Down Expand Up @@ -379,6 +391,7 @@ stereochemistry
sto
stober
str
stylesheet
subcircuits
subclasses
submodules
Expand Down Expand Up @@ -438,6 +451,8 @@ verbatim
vibrational
vibrationalop
vibro
vmax
vmin
vqe
vscf
vwn
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ unsafe-load-any-extension=no
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=
extension-pkg-whitelist=retworkx


[MESSAGES CONTROL]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
:no-members:
:no-inherited-members:
:no-special-members:

1 change: 0 additions & 1 deletion qiskit_nature/problems/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@
:toctree:
sampling
"""
8 changes: 8 additions & 0 deletions qiskit_nature/problems/second_quantization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
BaseProblem
ElectronicStructureProblem
VibrationalStructureProblem
Submodules
==========
.. autosummary::
:toctree: ../stubs/
lattice
"""

from .base_problem import BaseProblem
Expand Down
54 changes: 54 additions & 0 deletions qiskit_nature/problems/second_quantization/lattice/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
Lattice Problems (:mod:`qiskit_nature.problems.second_quantization.lattice`)
=============================================================================
The `Lattice` class is used to generate a general lattice,
which is a graph with complex-valued weights on its edges.
The `HyperCubicLattice` class and others provide standard lattices with certain
translational symmetries.
`Models` include classes that define Hamiltonians on a lattice.
It takes a lattice object and model parameters as input and
generates a Hamiltonian defined on the lattice.
.. currentmodule:: qiskit_nature.problems.second_quantization.lattice
Lattice
==============
.. autosummary::
:toctree: ../stubs/
Lattice
HyperCubicLattice
LineLattice
SquareLattice
TriangularLattice
Models
=======
.. autosummary::
:toctree: ../stubs/
FermiHubbardModel
"""
from .lattices import (
BoundaryCondition,
LatticeDrawStyle,
HyperCubicLattice,
Lattice,
LineLattice,
SquareLattice,
TriangularLattice,
)
from .models import FermiHubbardModel
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""A class containing information about the Lattice."""
from .boundary_condition import BoundaryCondition
from .hyper_cubic_lattice import HyperCubicLattice
from .lattice import LatticeDrawStyle, Lattice
from .line_lattice import LineLattice
from .square_lattice import SquareLattice
from .triangular_lattice import TriangularLattice
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
This module declares the available boundary conditions.
"""

from enum import Enum


class BoundaryCondition(Enum):
"""Boundary condition Enum"""

OPEN = "open"
PERIODIC = "periodic"
Loading

0 comments on commit 25c72a0

Please sign in to comment.