Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kwant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joseph Weston
kwant
Commits
9e7b8b16
There was a problem fetching the pipeline summary.
Commit
9e7b8b16
authored
8 years ago
by
Joseph Weston
Browse files
Options
Downloads
Patches
Plain Diff
add an `edges` method; the inverse of `node_pairs`
parent
8e386d7b
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kwant/system.py
+27
-4
27 additions, 4 deletions
kwant/system.py
with
27 additions
and
4 deletions
kwant/system.py
+
27
−
4
View file @
9e7b8b16
...
@@ -74,7 +74,7 @@ class System2(metaclass=abc.ABCMeta):
...
@@ -74,7 +74,7 @@ class System2(metaclass=abc.ABCMeta):
Raises
Raises
------
------
IndexError
IndexError
If any element of entries > num_entries.
If any element of entries >
=
num_entries.
"""
"""
@abc.abstractmethod
@abc.abstractmethod
...
@@ -98,6 +98,29 @@ class System2(metaclass=abc.ABCMeta):
...
@@ -98,6 +98,29 @@ class System2(metaclass=abc.ABCMeta):
If any element of entries >= num_entries.
If any element of entries >= num_entries.
"""
"""
@abc.abstractmethod
def
edges
(
self
,
heads
,
tails
):
"""
Get the edges corresponding to some hoppings.
Parameters
----------
heads, tails: sequence of int
The heads and tails of the hoppings to get.
Returns
-------
Sequence of int
The edges corresponding to the provided hoppings
Raises
------
IndexError
If any element of heads, tails >= num_nodes
KeyError
If a given hopping does not exist as an edge in the system
"""
@abc.abstractmethod
@abc.abstractmethod
def
neighbors
(
self
,
nodes
):
def
neighbors
(
self
,
nodes
):
"""
Get the neighbors of nodes and the corresponding edges.
"""
Get the neighbors of nodes and the corresponding edges.
...
@@ -118,7 +141,7 @@ class System2(metaclass=abc.ABCMeta):
...
@@ -118,7 +141,7 @@ class System2(metaclass=abc.ABCMeta):
Raises
Raises
------
------
IndexError
IndexError
If any element of nodes > num_nodes.
If any element of nodes >
=
num_nodes.
"""
"""
@abc.abstractmethod
@abc.abstractmethod
...
@@ -136,7 +159,7 @@ class System2(metaclass=abc.ABCMeta):
...
@@ -136,7 +159,7 @@ class System2(metaclass=abc.ABCMeta):
Raises
Raises
------
------
IndexError
IndexError
If any element of nodes > num_nodes.
If any element of nodes >
=
num_nodes.
"""
"""
@abc.abstractmethod
@abc.abstractmethod
...
@@ -209,7 +232,7 @@ class System2(metaclass=abc.ABCMeta):
...
@@ -209,7 +232,7 @@ class System2(metaclass=abc.ABCMeta):
Raises
Raises
------
------
IndexError
IndexError
If any element of nodes > num_nodes.
If any element of nodes >
=
num_nodes.
KeyError
KeyError
If g is not a group element.
If g is not a group element.
"""
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment