Ignore the last reply
Yes, in SOME states you might be able to keep the deposit, but not in California.
The deposit is intended for use to recover damages to the rental unit and unpaid rent for the balance of the lease term.
However, CA law also says that you cannot collect double rent for the same unit. Since your tenant broke their lease, you would be able to charge them for EITHER: the remaining term of their lease, OR lost rent up until you find a new tenant to replace the former tenant. NOT BOTH.
If the tenant failed to give proper notice, you can charge for the remaining days that make up the proper amount of notice, plus the remaining days up to the day that the new tenant took possession. If there is money remaining from the security deposit after damages and the total outstanding rent have been deducted, then you are required by law to refund it to the former tenant.
As the other poster said, you can't charge for "lost rent" when you haven't lost the rent.