Skip to content

Commit

Permalink
Implementation of the Hamiltonian class based on #3
Browse files Browse the repository at this point in the history
  • Loading branch information
matteogarbellini committed Nov 22, 2021
1 parent cbda257 commit 06caa55
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions Code /QW_Search.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,38 @@
- Robustness of the approach
- Localization and Multiple iteration search
"""

import sys
import time
import numpy as np
from scipy import linalg
from scipy.integrate import odeint, solve_ivp

import multiprocessing as mp
import ray

from numba import njit
from numba import int32, float64
from numba import types, typed, typeof, deferred_type
from numba.experimental import jitclass


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""" CLASS: HAMILTONIAN """""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

hamiltonian_types = [
('dimension', int32),
('type', int32),
('topology', ??), #char or numerical id?
('step_function', int32),
('target', int32),
('laplacian', float64[:]),
('hamiltonian', float64[:]),
]

@jitclass(hamiltonian_types):
class Hamiltonian:
"""Hamiltonian class"""
def __init__(self, dimension, type, topology, target, step_function):

0 comments on commit 06caa55

Please sign in to comment.