Commit f77a22f8 authored by robin.requadt's avatar robin.requadt
Browse files

Upload New File: P_amp.py

parent cb0297bc
from proxoperators import ProxOperator
import numpy as np
class P_amp(ProxOperator):
"""
Projection onto amplitude constraints
"""
def __init__(self, config):
"""
Initialization
Parameters
----------
config : dict - Dictionary containing the problem configuration. It must contain the following mapping:
'amplitude' : array_like - nonnegative array
"""
self.amplitude = config['amplitude']
def work(self,u):
"""
Evaluates Magproj (Projection operator onto a magnitude constraint) with arguments u and the amplitude constraints
Parameters
----------
u : array_like - complex-valued array to be projected onto the amplitude constraints
Returns
-------
array_like - the Projection
"""
a = self.amplitude
return eval('magproj(u,a)')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment