Skip to content
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

Launch Binder Not working #17

Open
Sulstice opened this issue Apr 18, 2022 · 8 comments
Open

Launch Binder Not working #17

Sulstice opened this issue Apr 18, 2022 · 8 comments

Comments

@Sulstice
Copy link

Hello,

Your Launch Binder feature is not working but it is working on google colab. Can we switch the demo to there?

@VHchavez
Copy link
Owner

Hello Sul, thank you for stopping by.
The project is in a big need of an overhaul. I will have some time in the next week for that.
There were some changes done in Psi4 that prevent the Binder to work... I will be fixing that as well.
I have never used Google Colab. You're more than welcome to help me set that up :) . I'd wait for all the other updates to complete though.

@Sulstice
Copy link
Author

Hey @VHchavez Sure I actually figured it out for google colab. I'll have a solid demo for you soon, give me a couple of days to wrap it up and I also used your software into mine, GlobalChem. Hope that is okay, I am extending the functionality of other stuff and moly is great for its visualization.

@Sulstice
Copy link
Author

Sulstice commented Apr 25, 2022

Demo

Here's the demo I made using some of your software, it has psi4 installation instructions in the first cell. Just hit the button play or play all.

@VHchavez
Copy link
Owner

Looks great thanks.
Now that I graduated, I have some time to work on this 🤣. Let me do the updates that I had in mind and then we can add your work to the main repo.
Thanks again!

@Sulstice
Copy link
Author

Yeah! haha.

It is actually part of a bigger project of mine if you want to somehow merge it in? It's going to be a paper soon, might be cool to rope it all in and have you be part of it. I read your code and it's really useful.

https://github.com/Sulstice/global-chem

What do you think?

@VHchavez
Copy link
Owner

Thanks for your kind words.
I think it is a good practice to keep projects as separate entities. Each of them with a single thing to do. So that if anyone else is interested in using it does not have to first decouple it from a larger project.
But I am more than happy to optimize and enhance moly in any way that GlobalChem requires.

@Sulstice
Copy link
Author

Works for me :)

I actually recently added this function and got it from forte to get cube files of occupied and virtual orbitals from psi4. What are your thoughts on it. Otherwise it's kind of a mess you get out for larger molecules:

def psi4_cubeprop(
            self,
            path,
            orbitals = [],
            number_occupied = 0,
            number_virtual = 0,
            density=False,
    ):

        """
        Run a psi4 cubeprop computation to generate cube files from a given Wavefunction object
        By default this function plots from the HOMO -2 to the LUMO + 2
        Arguments:
            path (String): file path to the output directory of the cube files
            orbitals (List): Any specific orbitals you want included,
            number_occupied (Int): Number of Molecule Orbitals Occupied by the Electron
            number_virtual (Int): Number of Virtual Orbitals Occupied by the Electron
            density (Bool): Density of the cubeprop
        """

        import os.path

        cubeprop_tasks = []

        if isinstance(orbitals, str):
            if orbitals == 'frontier_orbitals':
                cubeprop_tasks.append('FRONTIER_ORBITALS')
        else:
            cubeprop_tasks.append('ORBITALS')

            if number_occupied + number_virtual > 0:
                alpha_electrons = self.wave_function.nalpha()
                molecule = self.wave_function.nmo()
                min_orb = max(1, alpha_electrons + 1 - number_occupied)
                max_orb = min(molecule, alpha_electrons + number_virtual)
                orbitals = [k for k in range(min_orb, max_orb + 1)]

            print(f'Preparing cube files for orbitals: {", ".join([str(orbital) for orbital in orbitals])}')

        if density:
            cubeprop_tasks.append('DENSITY')

        if not os.path.exists(path):
            os.makedirs(path)

        psi4.set_options(
            {
                'CUBEPROP_TASKS': cubeprop_tasks,
                'CUBEPROP_ORBITALS': orbitals,
                'CUBEPROP_FILEPATH': path
            }
        )

        psi4.cubeprop(self.wave_function)

Could be worthwhile for additional mods?

@VHchavez
Copy link
Owner

I mean that's just how you get cube files using psi4 :)
I have tried moving sections like that to Python, but they've just been very inefficient. Cube files can get intractable very quickly, but that's just the nature of discretizing a massive chunk of space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants