Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • kwant kwant
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 144
    • Issues 144
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 20
    • Merge requests 20
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • kwantkwant
  • kwantkwant
  • Issues
  • #125
Closed
Open
Issue created May 12, 2017 by Bas Nijholt@basnijholtReporter

bug: discretizer string Hamiltonian and sympy Hamiltonian substitution behaves differently

import kwant
from kwant.continuum import momentum_operators, position_operators
import sympy

k_x = momentum_operators[0]
x = position_operators[0]
m, m_eff = sympy.symbols('m, m_eff', commutative=False)

print(kwant.continuum.discretize_symbolic('k_x * m(x) * k_x', substitutions={'m(x)': 'm_eff'}))

print(kwant.continuum.discretize_symbolic(k_x * m(x) * k_x, substitutions={m(x): m_eff}))
({(0,): m(-a/2 + x)/a**2 + m(a/2 + x)/a**2, (1,): -m(a/2 + x)/a**2}, ['x'])

({(0,): 2*m_eff/a**2, (1,): -m_eff/a**2}, ['x'])

@r-j-skolasinski

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking