### Install TorchRDIT via Pip Source: https://github.com/yi-huang-1/torchrdit/blob/main/README.md Standard installation command for the TorchRDIT package using the Python package manager. ```bash pip install torchrdit ``` -------------------------------- ### GDS Export/Import with TorchRdit Source: https://github.com/yi-huang-1/torchrdit/blob/main/README.md Demonstrates the comprehensive GDS (Generic Design System) file functionality, including exporting generated masks to GDS format and importing them back. This is useful for integrating TorchRdit designs with other GDS-based tools. ```python from torchrdit.shapes import ShapeGenerator from torchrdit.gds import mask_to_gds, gds_to_mask # Create shape and export to GDS shape_gen = ShapeGenerator(X, Y, grids) mask = shape_gen.generate_circle_mask(center=(0, 0), radius=0.5) mask_to_gds(mask, shape_gen.get_layout(), "DEVICE", "output.gds") # Import from GDS reconstructed = gds_to_mask("output.json", shape_gen) ``` -------------------------------- ### Compute Tangent Field for Fast Fourier Factorization Source: https://github.com/yi-huang-1/torchrdit/blob/main/README.md This snippet demonstrates how to compute the tangent field for FFF using the compute_tangent_field function. It supports multiple schemes like POL, NORMAL, and JONES to ensure compatibility with various Fourier factorization workflows. ```python from torchrdit.vector import compute_tangent_field tx, ty = compute_tangent_field( mask.float(), XO=solver.XO, YO=solver.YO, lattice_t1=solver.lattice_t1, lattice_t2=solver.lattice_t2, harmonics=tuple(int(k) for k in solver.harmonics), scheme="POL", # POL, NORMAL, JONES, or JONES_DIRECT ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.