If a jury has been impaneled and sworn to try the defendant, the jury shall be discharged only if it appears to the court that undue hardship to the jurors would result if the jury is retained on call.
If the defendant is declared mentally incompetent, the jury shall be discharged.
Ca. Pen. Code § 1368