A battery includes an anode, a cathode, and a polymer matrix electrolyte (PME) separator disposed between the anode and the cathode. The PME separator includes a polyimide, at least one lithium salt in a concentration of at least 0.5 moles of lithium per mole of imide ring provided by the polyimide, and at least one solvent intermixed. The PME is generally homogeneous as evidenced by its high level of optically clarity. The battery can be a lithium ion or lithium metal battery.