Package: taichi
pipinstalltaichi# Install Taichi Langtigallery# Launch demo galleryWhat is Taichi Lang?Taichi Lang is an open-source, imperative, parallel programming language for high-performance numerical computation. It is embedded in Python and uses just-in-time (JIT) compiler frameworks, for example LLVM, to offload the compute-intensive Python code to the native GPU or CPU instructions.The language has broad applications spanning real-time physical simulation, numerical computation, augmented reality, artificial intelligence, vision and robotics, visual effects in films and games, general-purpose computing, and much more....MoreWhy Taichi Lang?Built around Python: Taichi Lang shares almost the same syntax with Python, allowing you to write algorithms with minimal language barrier. It is also well integrated into the Python ecosystem, including NumPy and PyTorch.Flexibility: Taichi Lang provides a set of generic data containers known asSNode(/ˈsnoʊd/), an effective mechanism for composing hierarchical, multi-dimensional fields. This can cover many use patterns in numerical simulation (e.g.spatially sparse computing).Performance: With the@ti.kerneldecorator, Taichi Lang's JIT compiler automatically compiles your Python functions into efficient GPU or CPU machine code for parallel execution.Portability: Write your code once and run it everywhere. Currently, Taichi Lang supports most mainstream GPU APIs, such as CUDA and Vulkan.... and many more features! A cross-platform, Vulkan-based 3D visualizer,differentiable programming,quantized computation(experimental), etc.Getting StartedInstallationPrerequisitesOperating systemsWindowsLinuxmacOSPython: 3.6 ~ 3.10 (64-bit only)Compute backendsx64/ARM CPUsCUDAVulkanOpenGL (4.3+)Apple MetalWebAssembly (experiemental)Use Python's package installerpipto install Taichi Lang:pipinstall--upgradetaichiWe also provide a nightly package. Note that nightly packages may crash because they are not fully tested.  We cannot guarantee their validity, and you are at your own risk trying out our latest, untested features. The nightly packages can be installed from our self-hosted PyPI (Using self-hosted PyPI allows us to provide more frequent releases over a longer period of time)pipinstall-ihttps://pypi.taichi.graphics/simple/taichi-nightlyRun your "Hello, world!"Here is how you can program a 2D fractal in Taichi:# python/taichi/examples/simulation/fractal.pyimporttaichiastiti.init(arch=ti.gpu)n=320pixels=ti.field(dtype=float,shape=(n*2,n))@ti.funcdefcomplex_sqr(z):returnti.Vector([z[0]**2-z[1]**2,z[1]*z[0]*2])@ti.kerneldefpaint(t:float):fori,jinpixels:# Parallelized over all pixelsc=ti.Vector([-0.8,ti.cos(t)*0.2])z=ti.Vector([i/n-1,j/n-0.5])*2iterations=0whilez.norm()<20anditerations<50:z=complex_sqr(z)+citerations+=1pixels[i,j]=1-iterations*0.02gui=ti.GUI("Julia Set",res=(n*2,n))foriinrange(1000000):paint(i*0.03)gui.set_image(pixels)gui.show()If Taichi Lang is properly installed, you should get the animation below 🎉:SeeGet startedfor more information.Build from sourceIf you wish to try our our experimental features or build Taichi Lang for your own environments, seeDeveloper installation.DocumentationTechnical documentsAPI ReferenceBlogCommunity activityContributingKudos to all of our amazing contributors! Taichi Lang thrives through open-source. In that spirit, we welcome all kinds of contributions from the community. If you would like to participate, check out theContribution Guidelinesfirst.Contributor avatars are randomly shuffled.LicenseTaichi Lang is distributed under the terms of Apache License (Version 2.0).SeeApache Licensefor details.CommunityFor more information about the events or community, please refer tothis pageJoin our discussionsDiscordGitHub Discussions太极编程语言中文论坛Report an issueIf you spot an technical or documentation issue, file an issue atGitHub IssuesIf you spot any security issue, mail directly tosecurity@taichi.graphics.Contact usDiscordWeChatReferenceDemosNerf with TaichiTaichi Lang examplesAdvanced Taichi Lang examplesAwesome TaichiDiffTaichiTaichi elementsTaichi HoudiniMore...AOT deploymentTaichi AOT demos & tutorialLectures & talksSIGGRAPH 2020 course on Taichi basics:YouTube,Bilibili,slides (pdf).Chinagraph 2020 用太极编写物理引擎:哔哩哔哩GAMES 201 高级物理引擎实战指南 2020:课件太极图形课第一季：课件TaichiCon: Taichi Developer ConferencesMore to come...CitationsIf you use Taichi Lang in your research, please cite the corresponding papers:(SIGGRAPH Asia 2019) Taichi: High-Performance Computation on Sparse Data Structures[Video][BibTex][Code](ICLR 2020) DiffTaichi: Differentiable Programming for Physical Simulation[Video][BibTex][Code](SIGGRAPH 2021) QuanTaichi: A Compiler for Quantized Simulations[Video][BibTex][Code]