The primary hypothesis is that the effect size for reducing SI in the ketamine group vs. the midazolam group will be in the moderate range or above (d > 0.5 at 14 and 42 days) in terms of reduction in scores on the Scale of Suicidal Ideation (SSI) and the Columbia-Suicide Severity Rating Scale (CSSRS) for both subjects with MDD and subjects with bipolar depression.