Index on a Computed Column(using udf)
A PERSISTED COMPUTED column can't use Window functions like ROW_NUMBER(). It's one of the limitations because ROW_NUMBER() is not a deterministic function and only deterministic functions can be used with PERSISTED COMPUTED columns.
Paul White does a great write up on how to properly use PERSISTED COMPUTED columns in his article here.
Specifically he mentions how PERSISTED was added only for deterministic columns:

Persisted computed columns were added to the product specifically to
allow indexes to be built on deterministic but &quot;imprecise&quot; (floating
point) columns

If you could add a few more details on what your end goal is, I could try to suggest an alternative solution to solve the problem (e.g. what is the purpose of your UDF)?