Modern experimentation in business and public policy often studies targeted interventions whose effects depend on the heterogeneous attributes of individuals. We examine heterogeneous treatment effects through the lens of optimal design of experiments, which allocates treatment decisions to maximize the precision of estimated treatment-covariate interactions. We introduce the D-optimal partitioning problem for balancing the information matrices of the treatment and control groups. This problem generalizes the classical concept of D-optimal design, but is much more difficult: we prove that no polynomial-time additive approximation algorithm for D-optimal partitioning can exist unless P= NP. We derive a novel semidefinite programming formulation of this problem and propose a column generation algorithm with promising practical performance on both synthetic and real data.