{"id":47930813,"url":"https://github.com/proximafusion/raytrax","last_synced_at":"2026-05-11T09:55:04.107Z","repository":{"id":343264612,"uuid":"1020775643","full_name":"proximafusion/raytrax","owner":"proximafusion","description":"Raytrax: ECRH ray tracing in JAX","archived":false,"fork":false,"pushed_at":"2026-05-11T08:19:51.000Z","size":5509,"stargazers_count":13,"open_issues_count":5,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-11T09:37:48.611Z","etag":null,"topics":["diffrax","fusion","jax","plasma-physics","python","pyvista"],"latest_commit_sha":null,"homepage":"https://proximafusion.github.io/raytrax","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/proximafusion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-16T11:27:43.000Z","updated_at":"2026-05-08T06:10:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/proximafusion/raytrax","commit_stats":null,"previous_names":["proximafusion/raytrax"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/proximafusion/raytrax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proximafusion%2Fraytrax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proximafusion%2Fraytrax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proximafusion%2Fraytrax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proximafusion%2Fraytrax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/proximafusion","download_url":"https://codeload.github.com/proximafusion/raytrax/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proximafusion%2Fraytrax/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32889971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["diffrax","fusion","jax","plasma-physics","python","pyvista"],"created_at":"2026-04-04T07:17:08.747Z","updated_at":"2026-05-11T09:55:04.014Z","avatar_url":"https://github.com/proximafusion.png","language":"Jupyter Notebook","funding_links":[],"categories":["Tools"],"sub_categories":["Simulation and Modeling Frameworks"],"readme":"# Raytrax\n\n**An ECRH ray tracer for fusion plasmas, built on JAX.**\n\n[![CI](https://github.com/proximafusion/raytrax/actions/workflows/test.yml/badge.svg)](https://github.com/proximafusion/raytrax/actions/workflows/test.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Python ≥ 3.11](https://img.shields.io/badge/python-%E2%89%A53.11-blue)](https://www.python.org/)\n[![Documentation](https://img.shields.io/badge/docs-latest-informational)](https://proximafusion.github.io/raytrax/)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18924104.svg)](https://doi.org/10.5281/zenodo.18924104)\n\nRaytrax simulates Electron Cyclotron Resonance Heating (ECRH) of magnetic confinement fusion plasmas. Powered by [JAX](https://docs.jax.dev), it features JIT-compiled ray tracing and automatic differentiation — making it well-suited for gradient-based beam optimization in fusion plant design.\n\n\u003e **Note:** Raytrax is in early development. Expect API changes and incomplete validation. For details [see the docs](https://proximafusion.github.io/raytrax/limitations).\n\n## Usage\n\nLoad a magnetic equilibrium, define plasma profiles, and trace a beam:\n\n```python\nimport jax.numpy as jnp\nimport raytrax\nimport vmecpp\n\nvmec_wout = vmecpp.VmecWOut.from_wout_file(\"w7x.nc\")\nmag_conf = raytrax.MagneticConfiguration.from_vmec_wout(vmec_wout)\n\nrho = jnp.linspace(0, 1, 200)\nprofiles = raytrax.RadialProfiles(\n    rho=rho,\n    electron_density=2.0 * (1 - rho**2),\n    electron_temperature=3.0 * (1 - rho**2),\n)\nbeam = raytrax.Beam(\n    position=jnp.array([6.6, 0.0, 0.0]),\n    direction=jnp.array([-0.985, 0.0, -0.174]),\n    frequency=140e9,\n    mode=\"O\",\n    power=1e6,\n)\n\nresult = raytrax.trace(mag_conf, profiles, beam)\n\nprint(f\"Optical depth τ     = {result.optical_depth:.3f}\")\nprint(f\"Absorbed fraction   = {result.absorbed_power_fraction:.1%}\")\nprint(f\"Deposition at ρ     = {result.deposition_rho_mean:.2f} ± {result.deposition_rho_std:.2f}\")\n```\n\n## Visualizations\n\n### Beam trace on a poloidal cross-section\n\n\u003cimg src=\"docs/assets/readme_beam_trace.png\" alt=\"ECRH beam trace on W7-X R-Z cross-section\" width=\"380\"/\u003e\n\n### 3D visualization\n\nRaytrax can render flux surfaces and beam trajectories in 3D using [PyVista](https://pyvista.org):\n\n```python\nimport pyvista as pv\nfrom raytrax.plot.plot3d import plot_flux_surface_3d, plot_beam_profile_3d\n\nplotter = pv.Plotter()\nplot_flux_surface_3d(mag_conf, rho_value=1.0, plotter=plotter, opacity=0.25)\nplot_beam_profile_3d(result.beam_profile, plotter=plotter, tube_radius=0.02)\nplotter.export_html(\"scene.html\")  # interactive standalone HTML\n```\n\n\u003cimg src=\"docs/assets/readme_3d.png\" alt=\"3D visualization of W7-X flux surface and ECRH beam\" width=\"600\"/\u003e\n\n\u003e Try out a **[live interactive version](https://proximafusion.github.io/raytrax/3d-visualisation/)** in the docs.\n\n## Jupyter Notebooks\n\nQuick-start notebooks are in the [`notebooks/`](notebooks/) directory.\n\n## Installation\n\n```bash\npython -m pip install raytrax\n```\n\nSee the [documentation](https://proximafusion.github.io/raytrax/) for a full getting-started guide, theory background, and API reference.\n\n## Citing Raytrax\n\nIf you use Raytrax in your research, please cite it via Zenodo: [doi:10.5281/zenodo.18924104](https://doi.org/10.5281/zenodo.18924104).\n\n## Acknowledgements\n\nThe development of Raytrax is a collaboration between [Proxima Fusion](https://www.proximafusion.com) and the [Munich University of Applied Sciences (HM)](https://www.hm.edu) and was partially supported by the German Federal Ministry of Research, Technology and Space (BMFTR) under grant FPP-MC (13F1001B).\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/d/d3/Logo_Proxima_Fusion.svg\" alt=\"Proxima Fusion\" width=\"200\"/\u003e\n  \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003cimg src=\"https://upload.wikimedia.org/wikipedia/de/1/1e/Hochschule_f%C3%BCr_angewandte_Wissenschaften_M%C3%BCnchen_logo.svg\" alt=\"HM\" width=\"160\"/\u003e\n  \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003cimg src=\"docs/assets/bmftr.svg\" alt=\"BMFTR\" width=\"200\"/\u003e\n\u003c/div\u003e\n\n## License\n\nRaytrax is released under the MIT License. See [LICENSE.md](LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproximafusion%2Fraytrax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproximafusion%2Fraytrax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproximafusion%2Fraytrax/lists"}