QuantumATK Forum

QuantumATK => Scripts, Tutorials and Applications => Topic started by: minkowsky on November 30, 2012, 02:25

Title: How to generate zigzag edge GNR with nanoribbon function?
Post by: minkowsky on November 30, 2012, 02:25
the document tells nothing about this function and shows a wrong example.
I need to generate large among of GNRs with different width. I don't want to use mouse to do hundreds of times VNL operation. I know ribbon = NanoRibbon(10,0,Carbon,Carbon) can generate 10 atom armchair GNR. But how could I generate zigzag edge GNR with nanoribbon function? And how to generate the GNR and passivate the edge with desired atom? Could anyone provide a right document for this function? Really disappointed to the documents.
Title: Re: How to generate zigzag edge GNR with nanoribbon function?
Post by: Anders Blom on November 30, 2012, 12:07
I apologize for the confusion. We decided some time ago to not really support the function NanoRibbon, since it's so easy now to build graphene nanoribbons in the graphical interface, in the Builder in VNL.

But fortunately it still works, and for a zigzag edge you would just do NanoRibbon(10,10) for instance.

The example in the manual is, however, indeed wrong for the passivation. Here is how you need to do it now:

Code: python
from NL.CommonConcepts.Configurations.Passivate import passivate
ribbon = NanoRibbon(10,10)
ribbon = passivate(ribbon,selection=[True]*len(ribbon))
Title: Re: How to generate zigzag edge GNR with nanoribbon function?
Post by: minkowsky on November 30, 2012, 23:40
Thanks a lot.

What't the Methods to replace any atoms in one BulkConfiguration of ribbon?
Title: Re: How to generate zigzag edge GNR with nanoribbon function?
Post by: minkowsky on December 1, 2012, 02:36
Could you provide me the document for all the function in VNL?

Thanks

I apologize for the confusion. We decided some time ago to not really support the function NanoRibbon, since it's so easy now to build graphene nanoribbons in the graphical interface, in the Builder in VNL.

But fortunately it still works, and for a zigzag edge you would just do NanoRibbon(10,10) for instance.

The example in the manual is, however, indeed wrong for the passivation. Here is how you need to do it now:

Code: python
from NL.CommonConcepts.Configurations.Passivate import passivate
ribbon = NanoRibbon(10,10)
ribbon = passivate(ribbon,selection=[True]*len(ribbon))

Title: Re: How to generate zigzag edge GNR with nanoribbon function?
Post by: Anders Blom on December 3, 2012, 05:41
There is a complete description of the public API in the Reference Manual. However, in addition to that there is also a "secret" API which we use internally, which contains hundreds of useful functions. The reason these are publicly documented is mostly because we want to be free to change them as we like and need - and if they are public and people start using them, you get into issues with backwards compatibility.

Since most of the framework is object-oriented, the easiest way to find some of the "hidden" functionality is to query the objects. If you start "atkpython" in an interactive session, you can for instance type

Code: python
dir(BulkConfiguration)

and find the method you are looking for in this case: the private (and thus undocumented) "_changeAtoms". To access the doc-string for that, type

Code: python
help BulkConfiguration._changeAtoms

which at least shows which arguments you need to provide.

So to change atom numbers 4,5 and 10 (first atom has index 0) to Ruthenium, you can do

Code: python
my_system = NanoRibbon(10,10)
my_system._changeAtoms(indices=[4,5,10], elements=[Ruthenium,]*3)
nlprint(my_system)

And so on ;)
Title: Re: How to generate zigzag edge GNR with nanoribbon function?
Post by: minkowsky on December 5, 2012, 04:24
Thanks a lot.

How can I find the functions under NL.CommonConcepts.Configurations? And how can I use the molecular in database?
Title: Re: How to generate zigzag edge GNR with nanoribbon function?
Post by: Anders Blom on December 5, 2012, 16:18
As I mentioned above, you are not really supposed to have access to all functions in NL.something, since it's not part of the open API. Maybe later we can provide some deeper insight into this for Python experts, but we don't have any such material to share right now. We can help with specific questions, however.

I didn't understand the question on molecules. You can open the Database from the Builder and click "+" to add the selected molecule to the Stash, and then use it from there to modify it, add it to other structures, etc.