Text this: Quantum mechanics for hamiltonians defined as quadratic forms