Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
kwant
kwant
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 92
    • Issues 92
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 12
    • Merge Requests 12
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Registry
    • Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • kwant
  • kwantkwant
  • Issues
  • #81

Closed
Open
Opened Jan 25, 2017 by Anton Akhmerov@anton-akhmerov
  • Report abuse
  • New issue
Report abuse New issue

providing args and kwargs via system interface

After #77 (closed) the call signature of kwant.smatrix and other consumers of System have a rather lengthy call signature: kwant.smatrix(syst, energy, args=..., kwargs=...). It is counter-intuitive to supply arguments that the system consumes using awkward syntax and via an unrelated function.

I propose an alternative pathway for doing so. A method System.update_parameters(*args, **kwargs) that will return a shallow copy of the system that stores its arguments and keyword arguments such that the user doesn't need to provide them elsewhere. Example usage:

[kwant.smatrix(syst.update_parameters(0, B=5)) for B in fields]

Extra considerations

  • Systems already have a method precalculate that returns a modified shallow copy.
  • This change is fully backwards-compatible (old way of providing parameters would still work).
Assignee
Assign to
future
Milestone
future
Assign milestone
Time tracking
None
Due date
No due date
4
Labels
Needs Discussion difficulty: hard enhancement priority: low
Assign labels
  • View project labels
Reference: kwant/kwant#81