{"id":17239733,"url":"https://github.com/jjgoings/two-component_cubes","last_synced_at":"2026-02-06T01:35:51.449Z","repository":{"id":73083248,"uuid":"61314074","full_name":"jjgoings/two-component_cubes","owner":"jjgoings","description":"Python script to prepare complex, two-component Gaussian cube files to be read by GaussView or Pymol, etc.","archived":false,"fork":false,"pushed_at":"2016-12-07T22:51:31.000Z","size":26391,"stargazers_count":1,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-08T05:43:42.901Z","etag":null,"topics":["cube-files","gaussian","ghf","magnetization","plot"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jjgoings.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-06-16T17:47:50.000Z","updated_at":"2022-09-02T07:42:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"3291ab62-efc1-44b3-9377-6910854ff34b","html_url":"https://github.com/jjgoings/two-component_cubes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jjgoings/two-component_cubes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjgoings%2Ftwo-component_cubes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjgoings%2Ftwo-component_cubes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjgoings%2Ftwo-component_cubes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjgoings%2Ftwo-component_cubes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjgoings","download_url":"https://codeload.github.com/jjgoings/two-component_cubes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjgoings%2Ftwo-component_cubes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29143751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T01:13:33.096Z","status":"ssl_error","status_checked_at":"2026-02-06T01:11:47.313Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cube-files","gaussian","ghf","magnetization","plot"],"created_at":"2024-10-15T05:49:38.158Z","updated_at":"2026-02-06T01:35:51.428Z","avatar_url":"https://github.com/jjgoings.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cubes\n\n## Basic use\n\nThis is a python class to read and write out Gaussian cube files, \nwith a particular emphasisis on extracting complex and two-component molecular \norbitals.\n\nExample:\n\nSay you have a complex 2c MO cube called `twoc.cube`.\nIf you have `cube.py` in the same directory, you could write a script like\n```python\nfrom cube import Cube\ntwoc = Cube('twoc.cube')\ntwoc.write_out('twoc_ra.cube',data='RA')\ntwoc.write_out('twoc_ia.cube',data='IA')\ntwoc.write_out('twoc_rb.cube',data='RB')\ntwoc.write_out('twoc_ib.cube',data='IB')\n```\n\nOr, if you just cloned the whole directory you can run `cube.py` as-is\n\n```\n$ python cube.py\n```\n(You can modify the behavior of cube.py underneath the `if__name__ ==\n'__main__()':`)\n\nThis would create an object called `twoc`, which you could then dump out new\ncube files that are readable by GaussView corresponding to the real alpha\n(`data='RA'`), real beta (`data='RB'`), imaginary alpha (`data='IA'`), and\nimaginary beta (`data='IB'`). The default for `write_out` is real alpha.  \n\nThe code should be smart enough to distinguish between MO and density cube\nfiles.\n\nUsually there is no problem using GaussView for RHF and UHF anyway, so the code\nisn't yet generalized to all cases, but I'll work that out when I have time. \n\n## Vector quantities: Getting magnetization densities and electrostatic field gradients\n\nIf you generated your GHF cubes using the VSPIN (in the development version only of `cubegen`, I believe), you can also write out magnetization densities.\n\nSo, for example you ran the following:\n\n```\ncubegen 0 vspin ghf-vspin-example.fchk ghf-vspin-example.cube 40 h\n```\n\nThen you could do, e.g.\n```\nmagnetization = Cube('ghf-vspin-example.cube',vspin=True)\nmagnetization.write_out('Mz.cube',data='Mz')\n```\n\nThis would dump the z-component of the magnetization density to a new cube called `Mz.cube`. You can do this for the norm of the magnetization `data='N'`, as well as the x and y components of the magnetization (`data='Mx'` and `data='My'`, respectively). Densitites are always real.\n\nThere is also a new function to plot some vector quantities, if you have Mayavi installed. These are handled through the `plot_property` method. So continuing the example above,\n\n```\nmagnetization = Cube('ghf-vspin-example.cube',vspin=True)\nmagnetization.plot_property('MAG')\n```\n\nwould plot the magnetization vector at different points in 3D space. It's in beta, so you may need to fiddle around with the source to get it to do what you want.\n\nSimilarly, if you have an electrostatic potential generated by, for example, \n```\ncubegen 0 potential=scf esp-example.fchk esp-example.cube 80 h\n```\n\nThen you can do\n\n```\nESP = Cube('esp-example.cube')\nESP.plot_property('ESP')\n```\n\nwhich will plot the *gradient* (a vector) of your electrostatic potential. This is helpful for visualizing the electric field generated by a molecule with a dipole moment, for example.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjgoings%2Ftwo-component_cubes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjgoings%2Ftwo-component_cubes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjgoings%2Ftwo-component_cubes/lists"}