Conditional flow matching with composable dynamic constraint guidance for inverse design of terahertz metamaterials
Abstract
Efficient inverse design remains challenging for terahertz metamaterials. Existing methods often struggle to balance generation quality and inference efficiency, and the functionality of trained models is relatively fixed, making it difficult to flexibly adapt to additional design requirements. To address these issues, this paper proposes a conditional flow matching (CFM) framework with composable dynamic constraint guidance (CDCG) for parametric inverse design of terahertz metamaterial structures. As the generative backbone, CFM learns a conditional velocity field under a given target response and enables the progressive evolution from a random noise distribution to the structural-parameter distribution, while maintaining generation quality and improving inference efficiency. CDCG is introduced to decouple basic spectral-indicator generation from additional-objective guidance. It does not require backbone retraining. During inference, lightweight constraint predictors provide gradients, guiding generation toward feasible regions that satisfy the added constraints. Compared with denoising diffusion probabilistic models, CFM achieves a 4.5-fold increase in inference speed while maintaining accurate mapping from spectral responses to structural parameters. Compared with schemes that require model retraining when new design objectives are introduced, CDCG reduces the adaptation time from 1540 s to 70 s while maintaining comparable performance on the primary design metrics. In addition, the proposed framework enables coordinated optimization under conflicting constraints involving electromagnetic performance, material consumption, and structural feasibility, providing a flexible strategy for multi-objective inverse design of terahertz metamaterial structures.