{"id":16707422,"url":"https://github.com/cometscome/rscg_cpp","last_synced_at":"2025-03-14T16:41:26.232Z","repository":{"id":115248325,"uuid":"188200158","full_name":"cometscome/RSCG_cpp","owner":"cometscome","description":"The Reduced-Shifted Conjugate-Gradient Method method to calculate the element of the Green's function matrix. See, Y. Nagai, Y. Shinohara, Y. Futamura, and T. Sakurai,[arXiv:1607.03992v2 or DOI:10.7566/JPSJ.86.014708]. http://dx.doi.org/10.7566/JPSJ.86.014708  ","archived":false,"fork":false,"pushed_at":"2019-06-02T11:39:00.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T10:08:28.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/cometscome.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-23T09:10:17.000Z","updated_at":"2019-06-02T11:39:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"ac3384c7-c240-416f-be6e-e3dd50c1d24f","html_url":"https://github.com/cometscome/RSCG_cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometscome%2FRSCG_cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometscome%2FRSCG_cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometscome%2FRSCG_cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometscome%2FRSCG_cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cometscome","download_url":"https://codeload.github.com/cometscome/RSCG_cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243613969,"owners_count":20319601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-12T19:39:27.107Z","updated_at":"2025-03-14T16:41:26.209Z","avatar_url":"https://github.com/cometscome.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RSCG_cpp\nThis is made for c++11.\n\n\nThis package can calculate the elements of the Green's function:\n\n```math\nG_ij(σk) = ([σj I - A]^-1)_{ij},\n```\n\nwith the use of the reduced-shifted conjugate gradient method\n(See, Y. Nagai, Y. Shinohara, Y. Futamura, and T. Sakurai,[arXiv:1607.03992v2 or DOI:10.7566/JPSJ.86.014708]).\nOne can obtain ``G_{ij}(\\sigma_k)`` with different frequencies ``\\sigma_k``, simultaneously.\n\nThe matrix should be symmetric or hermitian.\n\nThis is to understand the method. \nI do not guarantee result with the use of this code. \n\n```c++\n#include \u003ciostream\u003e\n#include \u003cfunctional\u003e\n#include \u003cvector\u003e\n#include \u003carray\u003e\n\n#include \"rscg.cpp\"\n\nusing namespace std;\n\ntemplate \u003cint N\u003e\nvector \u003cdouble\u003e matmul(const std::array\u003cstd::array \u003cdouble, N\u003e,N\u003e \u0026H, vector \u003cdouble\u003e \u0026x){\n    vector \u003cdouble\u003e Ax(N);\n    for(int i = 0; i \u003c N; i++){\n        for(int j = 0; j \u003c N; j++){\n        Ax[i] += H[i][j]*x[j];\n        };\n    };\n    return Ax;\n};\n\nint main() {\n    std::array\u003cstd::array\u003cdouble, 3\u003e, 3\u003e H{ {\n        { 1, 0, 3 },\n        { 0, 2, 0 },\n        { 3, 0, 5 }\n    } };\n    vector \u003cdouble\u003e x(3,1.0);\n    auto f = std::bind(matmul\u003c3\u003e,H,std::placeholders::_1);\n\n    RSCG* rscg;\n    rscg = new RSCG(3,f);\n    vector\u003ccomplex \u003cdouble\u003e \u003e vec_z(2,0.2);\n    vec_z[0] = 0.2*1i;\n    vec_z[1] = 4.0 + 0.5*1i;\n    cout \u003c\u003c vec_z[0] \u003c\u003c std::endl;\n    vector\u003ccomplex \u003cdouble\u003e \u003e Gij = rscg-\u003ecalc_greenfunction_realH(0,0,vec_z);\n    cout \u003c\u003c \"RSCG\" \u003c\u003c Gij[0] \u003c\u003c \" exact: 1.12377 - 0.383299 I\" \u003c\u003c std::endl;\n    cout \u003c\u003c \"RSCG\" \u003c\u003c Gij[1] \u003c\u003c \" exact: 0.0844022 - 0.0339264 I\" \u003c\u003cstd::endl;\n};\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometscome%2Frscg_cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcometscome%2Frscg_cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometscome%2Frscg_cpp/lists"}