g2 = AtomicOrbital(center=0.4, alpha=10, pre_exponent=2) g2.normalize_square() g2.plot_function(-2, 2) print('integration g2^2 {:10.5f} {:10.5f}'.format( g2._full_integration_num_square(), g2.full_integration_square())) plt.show() # Generate orthogonal basis from basis functions basis = Basis(g1, g2) plt.title('MO basis eigenfunctions') print('Overlap_matrix') print(np.array(basis.get_overlap_matrix())) basis.plot_basis_function(-2, 2, 0, 0.001) basis.plot_basis_function(-2, 2, 1, 0.001) print('basis eigenfunction 1 integral', basis._get_integrate_test(0)) print('basis eigenfunction 2 integral', basis._get_integrate_test(1)) plt.show() # Create a arbitrary MO defined by the orthogonal basis phi = 2 # rad mo = MolecularOrbital(mo_coefficients=[np.sin(phi), np.cos(phi)], basis=basis) plt.title('Molecular orbital') mo.plot_function(-2, 2) plt.show()
g2 = AtomicOrbital(center=0.4, alpha=10, pre_exponent=2) g2.normalize_square() g2.plot_function(-2, 2) print('integration g2', g2._full_integration_num_square(), g2.full_integration_square()) plt.show() # Generate orthogonal basis from basis functions basis = Basis(g1, g2) plt.title('Basis functions') print(basis.get_eigenvalues()) print('Overlap_matrix') print(np.array(basis.get_overlap_matrix())) basis.plot_basis_function(-5, 5, 0, 0.001) basis.plot_basis_function(-5, 5, 1, 0.001) print('basis1', basis._get_integrate_test(0)) print('basis2', basis._get_integrate_test(1)) plt.show() # Create MO defined by the orthogonal basis mo = MolecularOrbital(mo_coefficients=[1 / np.sqrt(2), 1 / np.sqrt(2)], basis=basis) mo2 = MolecularOrbital(mo_coefficients=[1 / np.sqrt(2), -1 / np.sqrt(2)], basis=basis) plt.title('Molecular orbitals')