Implement phase 4 of the SQP algorithm in python.
Implement phase 4 of the SQP algorithm in python.