I just want to say how sorry I am for you. My PTSD comes from having a mother that behaved as your gf and with outrageous murder attempts. (just typing that out brings tremendous emotion to me still).
Part of my healing that I have not worked through is that I'm still asking why did my father stay with her? why did he not call the police? So your story and what your going through really caught me. It wasn't until his 17th year of marriage he left. His decision to leave the marriage was the impetus for her to get help. I really hope the hospital stay can help become "self-aware" of her condition.
I want to stress that I agree with JustMeHere do not ever think she will "get better." Because of my past I wish strongly that you will take care of yourself. That you will not isolate and that you will seek others for support-- real support. I hope you findt a few good, non-judgemental friends that you can share freely with, and your own mental health professional with an understanding of your religion, one with lots of experience with severe mental illness. If you are in the USA there is an organization "NAMI" that can offer you support groups with others whose loved one is mentally ill with psychosis, and offer you some resources.
Also, I would suggest you find your own therapist for you to work on you. Not just "how can I help my gf feel safe." But you need to work on your "why's" and your needs for your self and your own growth and healing. I beg you to take the violent attack seriously and do not look at this as an "isolated incident." Please do not look at it as caused by zoloft and she just needs a different med. You have been through a traumatic experience with this. I hope you will get the support you need. I understand what you are saying about the weirdness of your ex wife starting to text you non-stop at the same time your gf is in this altered state of reality, and that you were in a state of fear. That must have made the whole experience even more threatening, like an invisible force is out to get you. I'm thinking of you and wishing the very best outcome.