-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chiral GNRs and [n]-triangulene #644
Conversation
They look cool :) Actually the way I built the Lines 108 to 145 in 24c6406
And then duplicate it 6 times rotating 60º. So probably the two geometries can share some code. In fact the flake could be defined as a Regarding the API, could it make sense to have a general |
Well, it's not exactly a triangulene the thing I build, because it has one extra atom at each vertex of the triangle 😅 But still probably they can share code. |
@pfebrer , sounds like a good idea if some code can be shared. However, from the user's perspective I think it would be preferred to have |
Yes, I agree 👍 But I guess the main question is if you think it makes sense that |
By the way, being |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, looking very good! Many comments are sort of related, so I guess the first one to decide is the interface.
Does it matter? |
I guess an argument |
@tfrederiksen sorry, I messed up things! Thought I was on |
I think I fixed it, let me know if I caused problems!! :) |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #644 +/- ##
==========================================
+ Coverage 87.65% 87.67% +0.01%
==========================================
Files 364 364
Lines 48520 48566 +46
==========================================
+ Hits 42531 42578 +47
+ Misses 5989 5988 -1
☔ View full report in Codecov by Sentry. |
Hmm I don't know, some tools don't work well with non-orthogonal cells. Some of the SIESTA utils for example. In general it is much easier to work with orthogonal cells so I think for a 0D structure where the cell doesn't matter it would be better to have an orthogonal cell. Just to make life easier for users :) |
OK, I can change to an orthogonal for triangulene. |
I would still advocate the possibilities of retaining the non-orthogonal vectors when appending stuff, so could we retain both possibilities? :-) |
I agree to adapt a nonorthogonal cell for the chiral ribbons. I think the comment by @pfebrer only referred to triangulene. |
Yes, it's only for the triangulene |
Regarding the listing of geometries in the documentation: What do you think about moving "bulk" and "surfaces" into new subsections of a "3D materials" category? |
A separate pr for that please... Let's get this in. |
I've made some further changes according to the discussion above: Ribbons
g = sisl.geom.agnr(7, vacuum=0)
g.plot(axes='xy', atoms_scale=0.6, nsc=[6, 2, 1]) g = sisl.geom.zgnr(5, vacuum=0)
g.plot(axes='xy', atoms_scale=0.6, nsc=[6, 2, 1]) g = sisl.geom.cgnr(8, (3, 1), vacuum=10)
g.plot(axes='xy', atoms_scale=0.6, nsc=[3, 2, 1]) g = sisl.geom.nanoribbon(4, bond=1.6, atoms=("B", "N"), kind="chiral", chirality=(3, 1), vacuum=0)
g.plot(axes='xy', atoms_scale=0.6, nsc=[4, 2, 1]) Note that for chiral ribbons with even Triangulene
sisl.geom.triangulene(3, vacuum=5).plot(axes='xy', nsc=[2, 2, 1]) |
@pfebrer my changes here generate a conflict with the tests of your heteroribbons, more specifically def test_heteroribbon():
"""Runs the heteroribbon builder for all possible combinations of
widths and asserts that they are always properly aligned.
"""
# Build combinations
combinations = itertools.product([7, 8, 9, 10, 11], [7, 8, 9, 10, 11])
L = itertools.repeat(2)
for Ws in combinations:
geom = heteroribbon(
zip(Ws, L), bond=1.42, atoms=Atom(6, 1.43), align="auto", shift_quantum=True
)
# Assert no dangling bonds.
> assert len(geom.asc2uc({"neighbours": 1})) == 0
E AssertionError: assert 3 == 0
E + where 3 = len(array([ 0, 19, 22]))
E + where array([ 0, 19, 22]) = <bound method Geometry.sc2uc of <sisl.Geometry na=30, no=30, nsc=[3 1 1]>>({'neighbours': 1})
E + where <bound method Geometry.sc2uc of <sisl.Geometry na=30, no=30, nsc=[3 1 1]>> = <sisl.Geometry na=30, no=30, nsc=[3 1 1]>.asc2uc Some combinations in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't immediately see where things goes wrong, the only thing you are changing are the vacuum distances... Hmm..
I am also shifting the whole geometry in the cell (no atoms at the borders), by introducing this call: geom = geom.move(geom.center(what="cell") - geom.center()) |
that might be the reason... |
Ok, so apparently the vertical shift is fine, the only thing that broke is the longitudinal distance. It makes sense that it has changed if the original ribbons have been shifted, probably I just hardcoded their position longitudinally. Let me check. |
If it's a constant shift for all cases, I guess it would be enough to apply the opposite shift here: sisl/src/sisl/geom/nanoribbon.py Lines 334 to 336 in f06570c
But after giving it a thought, if it broke the generation of heteroribbons it is very likely that it will break other scripts. Is it really necessary to center along the longitudinal axis, or is it just an aesthetical choice? Because this is a backwards uncompatibility that is really hard to track an one can not really warn the users. |
…rds compatibility)
How does Could you add the parameter to the docstring of |
These vacuum arguments are nice, on a next iteration it would be ideal if users can control the vacuum for all non-PBC directions explicitly. Currently, all |
I'll merge once @pfebrer and @tfrederiksen have reached agreement :) |
@pfebrer , thanks, I've now added the docstring.
g = sisl.geom.graphene_heteroribbon([(5,2), (18, 2, -2), (7, 2), (11, 2)], kind='armchair', vacuum=0)
g.set_nsc([3, 3, 1])
g.plot(axes="xy", atoms_scale=0.6, nsc=[3, 2, 1]) |
It sounds like a good idea to try to unify this (in another PR). |
It works also if the widest segment has one of the edges "inside" the ribbon? E.g. if you shift up the 18 ribbon. |
Yes exactly, I was just afraid that the cell could follow the edge of the 18. Good! Nothing else to say then :) |
The lateral fusing of nanoribbons to NPG is also how they produce this experimentally ;) |
We are doing real science here hahah. "Bottom-up synthesis of NPG by introduction of the |
How is this coming along? Is it ready? |
I think it's ready, no? |
Ok, I'll merge soon |
Following #636 I would like to propose another two characteristic honeycomb geometries, namely chiral-GNRs [characterized by the chirality index
(n, m)
] as well as [n
]-triangulene.isort .
andblack .
at top-leveldocs/
CHANGELOG.md
Examples