input: Write a Python function to minimize a quadratic objective function subject to given constraints.
  assert np.allclose(solution.x, [1.0, 4.74299927, 1.37940829, 4.74299927], atol=1e-5)
  assert np.isclose(solution.fun, 44.754887585532745, atol=1e-5)
  assert solution.success == True
output: def minimize_quadratic():
      from scipy.optimize import minimize
      import numpy as np
  
      # Define the quadratic objective function
      def objective(x):
          return x[0]**2 + 2*x[1]**2 + 3*x[2]**2 + 4*x[3]**2 + 2*x[0]*x[1] + 3*x[1]*x[2] + 4*x[2]*x[3]
      
      # Define the constraints
      cons = ({'type': 'eq', 'fun': lambda x: x[0] + x[1] - 5},
              {'type': 'ineq', 'fun': lambda x: x[2] + x[3] - 3})
      
      # Initial guess
      x0 = np.zeros(4)
      
      # Solve the optimization problem
      solution = minimize(objective, x0, constraints=cons)
      
      return solution
  
  solution = minimize_quadratic()