# HINDI/BENGALI SENTIMENT ANALYSIS USING TRANSFER LEARNING AND JOINT DUAL
INPUT LEARNING WITH SELF ATTENTION

Shahrukh Khan Mahnoor Shahid<EMAIL_ADDRESS>mash00001@uni-
saarland.de
https://github.com/shahrukhx01/nnti_hindi_bengali_sentiment_analysis

###### Abstract

Sentiment Analysis typically refers to using natural language processing, text
analysis and computational linguistics to extract affect and emotion based
information from text data. Our work explores how we can effectively use deep
neural networks in transfer learning and joint dual input learning settings to
effectively classify sentiments and detect hate speech in Hindi and Bengali
data. We start by training Word2Vec word embeddings for Hindi HASOC dataset
and Bengali hate speech and then train LSTM and subsequently, employ parameter
sharing based transfer learning to Bengali sentiment classifiers by reusing
and fine-tuning the trained weights of Hindi classifiers with both classifier
being used as baseline in our study. Finally, we use BiLSTM with self
attention in joint dual input learning setting where we train a single neural
network on Hindi and Bengali dataset simultaneously using their respective
embeddings.

##  1 Introduction

There have been certain huge breakthroughs in the field of Natural Language
Processing paradigm with the advent of attention mechanism and its use in
transformer sequence-sequence models coupled with different transfer learning
techniques have quickly become state-of-the-art in multiple pervasive Natural
Language Processing tasks such as classification, named entity recognition
etc. In our work we reproduce some of that recent work related to the
sentiment analysis and classification on Hindi HASOC dataset here we reproduce
sub-task A which deals with whether a given tweet has hate-speech or not.
Moreover, this also serves as a source domain in the subsequent transfer
learning task, where, we take the learned knowledge from Hindi sentiment
analysis domain to similar binary Bengali sentiment analysis task.

Given the similar nature of both Bengali and Hindi sentiment analysis tasks
(i.e., binary classification), we conceptualized the problem as joint dual
input learning setting on top of reproducing the work of Zhouhan Lin et al.,
2017 where they suggested how we can integrate self attention with BiLSTMs and
have a matrix representation containing different aspects for each sequence
which results in sentence embeddings whilst performing sentiment analysis and
text classification more broadly. One significant beneficial side effect of
using such approach is that the attention matrix can easily be visualized
which imply we can see what portions of the sequence attention mechanism has
put more impetus on via its generated summation weights, this visualization
technique played pivotal role in selecting the number of attention hops $r$
also referred to as how many attention vectors of summation weights for each
sequence in our study. Moreover, we employed this approach in a joint dual
input learning setting where we have single neural network that is trained on
Hindi and Bengali data simultaneously.

##  2 Baseline Methodology

###  2.1 Data Pre-processing

####  2.1.1 Hindi Data Pre-processing

To begin with, we have done the pre-processing of the dataset where we have
removed the punctuation, usernames and stop-words, along with normalizing the
text data to lower case. Also we explored the distribution of response
variable which is binary variable indication whether a given tweet contains
hate speech or not. Following are the statistics for that variable:

Table 1: Tweets divided into Negative vs NonNegative Sentences Flag | No. of Sentences |  Proportion
---|---|---
HOF | 2469 |  52.92%
NOT | 2196 |  47.07%

##### Handling emojis

By analyzing the sentiment of the emojis we can draw several noteworthy
conclusions which might be motivating to the study of interest. Hence, with
the intention to obtain the emojis from the Hindi Dataset we have used regular
expressions and have specified all the Emoji Unicode Blocks in the pattern and
found just 2 emojis in the entire hindi dataset. So, removing them and not
removing them will not make any difference in this setting.

##### Handling Hashtags

We have used the matcher class from the Spacy package (python library) to
match the sequences of the tokens, based on pattern rules and obtained the
hash tags for both the negative and non-negative sentences. Mostly, there is
great influence of hashtags on the sentences, as just by observing the words
that are used as hashtags or by perceiving the high volumes of certain
hashtags can direct us to the subject of the content or the trending topic.
Correspondingly, it can affect the strength of the sentiment in a sentence,
for example multiple negative hashtags can increase the negative sentiment of
a tweet.

For these certain reasons we have settled not to eliminate them.

Figure 1: Hashtags in Hindi Dataset for Negative vs Non-Negative Sentences
based on label column Figure 2: WordCloud indicating the most frequent
hashtags in the Hindi Dataset

####  2.1.2 Bengali Data Pre-processing

We started by first splitting the actual Bengali dataset and taking 2500
positive label examples, and 2500 negative label examples sampled randomly
from the actual dataset of 30000 examples. This roughly makes the Bengali
subset equivalent to the Hindi dataset and also avoids the problem of class
imbalance since we have equal number of examples for both classes.

We performed a short analysis on the Bengali dataset as well, for emojis and
hashtags, using the same approach as mentioned in section 3. The results we
obtained were 27 hashtags with only 4 of them being in the negative sentences
and got 7426 emojis of various kind with 5241 emojis used in the hatespeech
texts and 2185 in non-hatespeech texts. The most frequently used top 6 emojis
in the Bengali dataset can be observed from Figure 3.

Figure 3: Frequency of Emojis used in the Sentences of Bengali Dataset

As it is apparent from the above stacked chart each type of emoji has more
volume in either sentiment class, which can help the classifier in
classification of the sentiment. So, for the very same reason, we have not
deviated from the text pre-processing pipeline adapted in the Hindi dataset,
also, we retained both the emojis and hashtags here as well for the very same
reasons as described earlier.

###  2.2 Word Embeddings

Starting with the Hindi dataset, we pre-processed the dataset as per the
pipeline described in section 2.1.1. We prepared the training dataset in which
employed sub-sampling technique in which we first computed the probability of
keeping the word using the following formula:

$P_{keep}(w_{i})=(\sqrt{\dfrac{z(w_{i})}{0.000001}}+1).\dfrac{0.000001}{z(w_{i})}$

Where $z(w_{i})$ is the relative frequency of th word in the corpus. Hence we
used $P_{keep}(w_{i})$ for each context word while sampling context words for
a given word and randomly dropped frequent context words by comparing them
against a random threshold sampled each time from uniform distribution, since
if we kept all the frequent words in our context for training data, we may not
get rich semantic relationship between the domain specific words since
frequent words like "the", "me" etc don’t necessarily carry much semantic
meaning in a given sequence. Hence dropping randomly dropping them made more
sense as compared to keeping or dropping all of them. Also, another important
design decision that we made here was to curate the train set for Word2Vec
only once before training the model as opposed to creating a different one for
each epoch as we were randomly sub-sampling context words, because the earlier
mentioned approach gives faster execution time for training the model while
the model also converged well to a relatively low train loss value as well.
Furthermore, for choosing hyper-parameters we performed the following
analysis.

Figure 4: Train loss convergence for different values of window size with
fixed embedded size = 300 Hindi Dataset

As it is apparent from the above visualization WordVec models with smaller
context windows converged faster and had better train loss at the end of
training process. However, in order to retain some context based information
we selected the window size 2 as it has contextual information as well the
model had better train loss.

Table 2: Different combinations of hyper parameters from Hindi Dataset Embedded Size | Learning Rate | Window Size | Min Loss Score
---|---|---|---
300 | 0.05 | 1 | 0.841
2 | 1.559
3 | 1.942
4 | 2.151
5 | 2.321
10 | 2.792
0.01 | 1 | 1.298
2 | 3.295
10 | 2.747
| 0.1 | 1 | 1.311
| 2 | 1.557
| 10 | 3.551

After testing different values for hyper-parameters with different
combinations, this was observed that for the better performance of the model,
they should be set to Epochs = 500, Window Size = 2, Embedded Size = 300, and
Learning Rate = 0.05 in the case of our study.
Also, we have set Cross Entropy Loss as the criterion used for adjusting the
weights during the training phase. When softmax converts logits into
probabilities then, Cross-Entropy takes those output probabilities (p) and
measures the distance from the truth values to estimate the loss. Cross
entropy loss inherently combines log softmax and negative log likelihood loss
so we didn’t apply log softmax on the output of our Word2Vec model.

For optimization we have selected Adam (Adaptive Moment Estimation algorithm)
which is an optimization technique that, at present, is very much recommended
for its computational efficency, low memory requirement, invariant to diagonal
rescale of the gradients and extremely better results for problems that are
large in terms of data/parameters or for problems with sparse gradients. Adam
provides us with the combination of best properties from both AdaGrad and
RMSProp, and is often used as an alternative for SGD + Nesterov Momentum as
proposed by Diederik P. et al., 2015.

###  2.3 Baseline Models

For the choice of baseline we reproduced the work by Jenq-Haur Wang et al.,
2018 which primarily focuses on performing sentiment classification on short
social media texts using long short-term memory neural networks using
distributed representations of Word2Vec learned using Skip-gram approach. We
chose to reproduce their work for our baseline as they also were using
Word2Vec Skip-gram based distributed representation of words and also since
our datasets were also sourced from social media. Moreover, the neural network
LSTM is an upgraded variant of the RNN model, that serves as the remedy to
some extent of the problems that requires learning long-term temporal
dependencies; due to vanishing gradients, since LSTM uses gate mechanism and
memory cell to control the memorizing process.

####  2.3.1 Hindi Neural Sentiment Classifier Baseline

Firstly, we applied the same text pre-processing pipeline as described in
2.2.1. Then we divided the Hindi dataset into 2985 examples in train set, 746
examples in validation set and 932 examples in test set. We then implemented
the architecture for LSTM classifier which used pre-trained 300 dimensional
word embeddings obtained as described in section 2.2. We used Adam optimizer
for the same reasons listed in section 2.2 with the initial learning rate of
$10^{-4}$ which helped the train and validation loss to converge at a
relatively fast rate, the optimizer didn’t optimize the weights of embedding
layer via gradient optimization since they were pre-trained already. Moreover,
we chose binary cross entropy loss function as we are doing binary
classification. Binary cross entropy is designed to work with a single sigmoid
function as output activation, which we have included in our network, In model
architecture we used $8$ layers of LSTMs with each having hidden dimension of
64 followed by a dropout layer with dropout probability of $0.5$ to
counterbalance over fitting and finally fully connected output layer wrapped
by a sigmoid activation function since our target is binary and sigmoid is the
ideal choice for binary classification given its mathematical properties. We
kept a batch size of $32$ and trained the model for $30$ epochs while
monitoring its accuracy and loss on validation set. The choice of hyper-
parameters was made after trying different combinations and we chose the bet
set of hyper-parameters while monitoring the validation set accuracy.

####  2.3.2 Bengali Neural Transfer Learning Based Sentiment Classifier
Baseline

Firstly, we applied the same text pre-processing pipeline as described in
2.2.2. Then we divided the Bengali dataset into 3194 examples in train set,
798 examples in validation set and 998 examples in test set. Similarly to the
Hindi sentiment classification pipeline, we first obtained the word embeddings
for Bengali data using the Word2Vec skip-gram approach, the same set of hyper-
parameters that we chose for Hindi dataset, worked fine here well, so we
didn’t tune the hyper-parameters here, as the model’s train loss converged to
similar value we had for the Hinidi dataset. Subsequently, we then same the
architecture for LSTM based classifier architecture as explained in 2.2.2.
Since our goal here was to perform transfer learning and re-use and fine-tune
the learned weights of Hindi classifier. We replaced the Hindi embeddings
layer with Bengali 300 dimensional embedding layer and also didn’t optimize
its weights during training. The loaded the weights from Hindi classifier for
LSTM layers and fully connected layer to apply parameter sharing based task
specific transfer learning. Additionally, we trained the Bengali classifier
for 30 epochs with batch size of 32 and using the Adam optimizer with initial
learning rate $10^{-4}$ while using binary cross entropy function for
computing loss on training and validation set. The choice of batch size hyper-
parameter was made after trying different values and we chose the best hyper-
parameter while monitoring the validation set accuracy. After training the
classifier using the pre-trained weights from Hindi classifier, we got better
performance results to the Hindi baseline, this implies task based transfer
learning actually boosted the performance of Bengali classifier and it
performed better.

##  3 Our Work

The LSTM based classifier coupled with transfer learning in Bengali domain do
a fairly good job for providing the baselines in our study. However, one main
prominent shortcoming of Recurrent Neural Networks based architectures is they
fall short to capture the dependencies between words that are too distant from
each other. LSTM’s forget gate enables it to retain information of the
historical words in the sequence however, it doesn’t completely resolve the
RNN based networks vanishing gradients problem. We wanted to investigate
whether using self attention with LSTMs would improve our model’s performance.
Also, we propose the joint dual input learning setting where both Hindi and
Bengali classification tasks can benefit from each other rather than the
transfer learning setting where only the target task takes the advantage of
pre-training.

###  3.1 Hindi & Bengali Self Attention Based Joint Dual Input Learning BiLSTM
Classifier

Instead of training two separate neural networks for Hindi & Bengali, here we
simultaneously trained a joint neural network with the same architecture on
Hindi and Bengali data in parallel, and optimized its weights using the
combined binary cross entropy loss over Hindi & Bengali datasets respectively,
we also added the Hindi and Bengali batches’ attention loss to the joint loss
in order to avoid overfitting, which we would present in detail in the
subsequent sections. Here we switched between the embedding layers based on
the language of the batch data. Following is the block architecture we
propose.

Figure 5: Hindi Bengali Joint Dual Input Learning Architecture

One major benefit of using such technique is that it increases model
capability of generalization, since the size of training data set roughly
doubles given if both languages have equal number of training examples.
Consequently, it reduces the risk of over-fitting.

We started with re-producing the work of Zhouhan Lin et al., 2017 where they
proposed the method of "A Structured Self-attentive Sentence Embedding" on
Hindi dataset. The key idea of that work was to propose document level
embeddings by connecting self attention mechanism right after a Bi-directional
LSTM, which leverages information of both past and future in the sequence as
opposed to unidirectional LSTM which only relies on past information in the
sequence. The self attention mechanism results in a matrix of attention
vectors which are then used to produce sentence embeddings, each of them
equivalent to the length of the sequence and number of vectors depends on the
value of $r$ which is the output dimension of the self attention mechanism,
where each vector is representing how attention mechanism is putting more
relative weight on different tokens in the sequence. Following are the key
takeaways how self attentive document embeddings are produced:
We start with a input text T of $(n,d)$ dimension, where n are the number of
tokens, each token is represented by its embedding $e$ in the sequence and $d$
is the embedding dimension.

$T=[e_{1},e_{2},e_{3},...,e_{n}]$

Token embeddings are then fed into the BiLSTM, which individually processes
each token from left to right and left to right direction, each BiLSTM
cell/layer producing two vectors of hidden states equivalent to length of
sequence.

$[[\overrightarrow{h_{1}},\overrightarrow{h_{2}},....,\overrightarrow{h_{n}}],[\overleftarrow{h_{1}},\overleftarrow{h_{2}},....,\overleftarrow{h_{n}}]]=BiLSTM([e_{1},e_{2},e_{3},...,e_{n}];\theta)$

Here H is the concatenated form of bi-directional hidden states. If there are
$l$ LSTM layers/cells then the dimension of H is going to be $(n,2l)$.

$\textbf{H}=[[\overrightarrow{h_{1}},\overrightarrow{h_{2}},....,\overrightarrow{h_{n}}],[\overleftarrow{h_{1}},\overleftarrow{h_{2}},....,\overleftarrow{h_{n}}]]$

For self attention Zhouhan Lin et al., 2017 proposed having two weight
matrices, namely $W_{s_{1}}$ with dimension $(d_{a},2l)$ and $W_{s_{2}}$ with
dimension $(r,d_{a})$, here $d_{a}$ is the hidden dimension of self attention
mechanism and as described earlier $r$ is the number of attention vectors for
a given text input and then we apply following set of operations to produce
the attention matrix for input text T.

$H_{a}=tanh(W_{s_{1}}H^{T})$

Here $H_{a}$ has dimensions $(d_{a},n)$

$A=softmax(W_{s_{2}}H_{a})$

Finally, we compute sentence/document level embeddings

$M=AH$

$A$ has dimensions $(r,n)$ and $M$ has dimensions $(r,2l)$ and also, earlier
the softmax applied along second dimension of $A$ normalizes attention weights
so they sum up 1 for each attention vector of length $n$.

The above work also proposed penalization term in place of regularization to
counterbalance redundancy in embedding matrix $M$ when attention mechanism
results in same summation weights for all $r$ hops, additionally, We initially
started by setting this penalization term to $0.0$ however, as self-attention
generally works well for finding long term dependencies the neural network
started to overfit after few epochs of training on train data.

We started with the same hyper-parameters setting of self attention block as
described by Zhouhan Lin et al., 2017 while setting $r=30$ however, we started
with no penalization to start with and found the best values for them while
monitoring the validation set accuracy which are hidden dimension of $300$ for
self attention, with $8$ layers of BiLSTM with hidden dimension of $32$ and
also, the output of self attention mechanism (sentence embeddings $M$) goes
into a fully connected layer with its hidden dimension set to $2000$, finally
we feed the fully connected layer’s results to output layer wrapped with
sigmoid activation. The choice of loss function, learning rate and optimizer
remains unchanged from the baseline, number of epochs are $20$ here. After
training the model with hyper parameters suggested in the above text, we
observed the model started to overfit on train data after few epochs and
almost achieved $99\%$ train accuracy and loss less than $0.5$ average epoch
train loss, in order to add the remedy for this we we visually inspected the
few of the examples from test set in attention matrix with confidence $>0.90$
and observed for longer sequences the attention mechanism worked as expected
however, as the sequence length decreased the attention mechanism started
producing roughly equal summation weights on all $r$ hops which intuitively
makes since in short sequences all tokens would carry more semantic
information however, this result in redundancy in attention matrix $A$ and in
embedding matrix $M$. Below we present some of the examples from Hindi test
set, also since showing all the vectors would make it redundant so we only
present $5$ vectors for a given sequence even though we had $r$ set to $30$
which implies we had 30 vectors for each sequence.

Figure 6: Attention vectors for a relatively longer Hindi sequence Figure 7:
Attention vectors for a relatively medium Hindi sequence Figure 8: Attention
vectors for a short Hindi sequence

Also, we performed the same analysis as we performed for Hindi data. Following
we would also show few similar examples as we showed for Hindi sequences.

Figure 9: Attention vectors for a short Bengali sequence Figure 10: Attention
vectors for a short Bengali sequence

In order to counterbalance this redundancy we started increasing the value of
penalization coefficient of attention mechanism in order to reduce the
redundancy among the attention matrix and found penalization coefficient of
$0.6$ produced the best validation set accuracy, similarly, the other form of
diagnosis we performed was to actually reduce the number of attention hops ,
i.e., varying the hyper-parameter r and observed network with r = 20 had
better performance on validation, alongside setting hidden size of attention
mechanism to $150$ set as compared to r = 30 and hidden size =200 as suggested
in the original work. Also, in order to avoid any over-fitting during in the
BiLSTM block we used dropout in BiLSTM layers with a value of p = 0.5.

##  4 Results

Note:  Model names have links to respective model notebook. Precision, Recall
and F-1 are macro averaged. SA refers to self attention. PRET refers to using
pre-trained Hindi weights for the corresponding architecture and JDIL refers
to joint dual input learning.

Table 3: Results of evaluating the binary neural Hindi and Bengali sentiment classifiers on their respective test sets Model | Accuracy | Precision | Recall | F-1 Score
---|---|---|---|---
LSTM-Hindi | 0.74 | 0.74 | 0.74 | 0.74
LSTM-Bengali + PRET | 0.77 | 0.77 | 0.77 | 0.77
BiLSTM-Hindi/Bengali SA + JDIL (lang=Hindi) | 0.76 | 0.76 | 0.76 | 0.76
BiLSTM-Hindi/Bengali SA + JDIL (lang=Bengali) | 0.78 | 0.78 | 0.78 | 0.78

##  5 Conclusion

In our study we investigated whether self attention can enhance significantly
the performance over uni-directional LSTM in the binary classification task
setting, moreover, we also investigated when the tasks are same in our case
binary classification in Hindi and Bengali language, whether how does transfer
learning and joint dual input learning setting perform. Firstly we found when
the lengths of sequences are not that long LSTMs can perform almost as good as
using self attention since there are no very distant dependencies in sequences
in most of the cases. Secondly, we observed that transfer learning in case
similar or same tasks can be beneficial way of increasing the performance of
target task which in our case was Bengali binary classification. However, by
introducing the joint learning setting where we trained a single network for
both task the Hindi classification task that was source task in transfer
learning setting, also got benefited in joint learning setting as its
performance improved. Moreover, such architecture provides implicit mechanism
to avoid overfitting as it roughly doubled the dataset size when we trained a
single network. Lastly, although self attention based mechanism improved our
model’s performance slightly, however, the performance gains were not
significant one possible reason behind that could be since the input sequences
weren’t really long such as compared to Wikipedia article, or an online news
article etc, so LSTM based model performed effectively as well because of the
absence of very distant dependencies in the input sequences. In conclusion in
such cases vanilla LSTMs should be the first choice as per Occam Razor’s
principle which suggests simpler models have less chances of overfitting on
train data and better capability of generalization as compared to more complex
models.

## References

[1] An LSTM Approach to Short Text Sentiment Classification with Word
Embeddings. Jenq-Haur Wang, Ting-Wei Liu, Xiong Luo and Long Wang. The 2018
Conference on Computational Linguistics and Speech Processing ROCLING 2018,
pp. 214-223. https://www.aclweb.org/anthology/O18-1021.pdf

[2] A Structured Self-attentive Sentence Embedding. Zhouhan Lin and Minwei
Feng, Cicero Nogueira dos Santos, Mo Yu, Bing Xiang, Bowen Zhou, and Yoshua
Bengio. Published as a conference paper at ICLR 2017.
https://arxiv.org/pdf/1703.03130.pdf

[3] Exploiting Document Knowledge for Aspect-level Sentiment Classification.
Ruidan He, Wee Sun Lee, Hwee Tou Ng, and Daniel Dahlmeier.
https://arxiv.org/pdf/1806.04346.pdf

[4] Overview of the hasoc track at fire 2019: Hate speech and offensive
content identification in indo-european languages. Thomas Mandl, Sandip Modha,
Prasenjit Majumder, Daksh Patel, Mohana Dave, Chintak Mandlia, and Aditya
Patel. In Proceedings of the 11th Forum for Information Retrieval Evaluation,
pages 14–17, 2019.

[5] Adam: A Method for Stochastic Optimization Diederik P. Kingma, Jimmy Ba.
Published as a conference paper at ICLR 2015.
https://arxiv.org/pdf/1412.6980.pdf

[6] Long Short-Term Memory. Jurgen Schmidhuber. Sepp Hochreiter. Neural
Computation 9(8): 1735-1780, 1997.
http://www.bioinf.jku.at/publications/older/2604.pdf


# A note on the Fourier magnitude data and Sobolev embeddings

Jesse Railo  Computational Engineering, School of Engineering Sciences,
Lappeenranta-Lahti University of Technology LUT, Lappeenranta, Finland
<EMAIL_ADDRESS>
(Date: April 20, 2024)

###### Abstract.

We study Sobolev $H^{s}(\mathbb{R}^{n})$, $s\in\mathbb{R}$, stability of the
Fourier phase problem to recover $f$ from the knowledge of $|\hat{f}|$ with an
additional Bessel potential $H^{t,p}(\mathbb{R}^{n})$ a priori estimate when
$t\in\mathbb{R}$ and $p\in[1,2]$. These estimates are related to the ones
studied recently by Steinerberger in ”On the stability of Fourier phase
retrieval” _J. Fourier Anal. Appl._ , 28(2):29, 2022. While our estimates in
general are different, they share some comparable special cases and the main
improvement given here is that we can remove an additional imaginary term and
obtain sharper constants. We also consider these estimates for the quotient
distances related to the non-uniqueness of the Fourier phase problem. Our
arguments closely follow the Fourier analysis proof of the Sobolev embeddings
for Bessel potential spaces with minor modifications.

###### Key words and phrases:

Phase retrieval, Fourier transform, Bessel potentials, Sobolev inequalities

##  1\. Introduction

The Fourier phase problem studies the recovery of information about a function
$f$ from the knowledge of the magnitude of its Fourier transform $|\hat{f}|$
where the Fourier transform is defined with the convention

(1)
$\hat{f}(\xi):=\mathcal{F}f(\xi):=(2\pi)^{-n/2}\int_{\mathbb{R}^{n}}e^{-ix\cdot\xi}f(x)dx.$

This problem has non-unique solutions for several reasons. For example, $f$
and $cf$ have the same Fourier magnitude data for any constant
$c\in\mathbb{C}$ with $|c|=1$. See the discussion in Section 2.2, Appendix B,
and the survey [GKR20] for other obstructions of uniqueness.

The first systematic mathematical studies of the Fourier phase retrieval are
due to Akutowicz [Aku56, Aku57], Walther [Wal63], and Hofstetter [Hof64],
where the uniqueness questions were considered in one-dimension for compactly
supported functions. Possible imaging applications include X-ray
crystallography, transmission electron microscopy and coherent diffractive
imaging [Fie82, BBE17, GKR20]. Other works on the uniqueness properties of the
Fourier phase problem include, for example, [CF83, KST95].

In this note, we consider inequalities related to the stability of Fourier
phase retrieval. Our main result gives mixed estimates for general
$H^{s}(\mathbb{R}^{n})$, $s\in\mathbb{R}$, quotient distances related to the
non-uniqueness of the Fourier phase problem using the Fourier magnitude
difference data $||\hat{f}|-|\hat{g}||$ and certain a priori estimates given
in terms of the Bessel potentials norms $H^{t,p}(\mathbb{R}^{n})$,
$p\in[1,2]$, $t\in\mathbb{R}$. This result is stated in Theorem 1.1. This
improves some of the recent results in [Ste22] as explained in the discussion
of Section 1.2. One may remove the a priori estimates if
$\operatorname{supp}(\hat{f})\neq\operatorname{supp}(\hat{g})$ but such
estimates seem to hold for almost trivial reasons and without a good control
of constants as Appendix A demonstrates.

The question of stability for the Fourier phase retrieval has been studied
recently in [GKR20, Theorem 4.13] with additional measurements and in [Ste22]
with an additional a priori information. The stability of other or general
phase retrieval problems has been a very active topic of study in the last few
years. See for example [BCMN14, BW15, CCD16, AG17, ADGY19, GR19, IMP19, GR22,
CDDL20, AG21, AW21] and the references therein.

We introduce the main result in Section 1.1. We consider preliminaries in
Section 2. We give the proof of our main theorem in Section 3. We consider
other aspects of the stability of the Fourier phase problem in Appendices A
and B in some simpler special cases.

###  1.1. Main result

We briefly introduce the used notation first and then state our main theorem.
More details are given in Section 2. We denote
$\left\langle\xi\right\rangle=\sqrt{1+|\xi|^{2}}$ for any
$\xi\in\mathbb{R}^{n}$ and define _Bessel potential spaces_ for any
$t\in\mathbb{R}$ and $p\in[1,\infty]$ as

(2)
$H^{t,p}(\mathbb{R}^{n}):=\\{\,f\in\mathcal{S}^{\prime}(\mathbb{R}^{n})\,;\,\mathcal{F}^{-1}(\left\langle\cdot\right\rangle^{t}\hat{f})\in
L^{p}(\mathbb{R}^{n})\,\\}$

equipped with the norm
$\|f\|_{H^{t,p}(\mathbb{R}^{n})}:=\|\mathcal{F}^{-1}(\left\langle\cdot\right\rangle^{t}\hat{f})\|_{p}$.
For the space $H^{s}(\mathbb{R}^{n})$, we use directly the Fourier side norm
$\|\left\langle\cdot\right\rangle^{s}\hat{f}\|_{2}$, which is equal to the
norm of $H^{s,2}(\mathbb{R}^{n})$ up to a positive constant.

We denote by $\mathcal{F}^{s}(\mathbb{R}^{n})$ the group of bijective and
additive operators (not necessarily linear) $P:H^{s}(\mathbb{R}^{n})\to
H^{s}(\mathbb{R}^{n})$ with the property

(3) $|\hat{f}(\xi)|=|\widehat{Pf}(\xi)|\quad\forall\xi\in\mathbb{R}^{n},\quad
f\in H^{s}(\mathbb{R}^{n}).$

The related group operation is the usual composition of mappings. If $G$ is a
subgroup of $\mathcal{F}^{s}(\mathbb{R}^{n})$, then the related quotient
distance is defined as

(4) $d([f],[g])=\inf_{P\in G}\|f-Pg\|_{H^{s}(\mathbb{R}^{n})}$

for the equivalance classes of $f,g\in H^{s}(\mathbb{R}^{n})$: $[f]=[g]$ if
and only if $f=Pg$ for some $P\in G$. See Section 2.2 for a brief discussion
of the non-uniqueness of the Fourier phase problem.

Our main theorem is an estimate which combines the fractional Sobolev
inequalities with the Fourier magnitude data. We write $A_{f\cap
g}=\operatorname{supp}(\hat{f})\cap\operatorname{supp}(\hat{g})$ in the
statement of Theorem 1.1.

######  Theorem 1.1.

Let $n\in\mathbb{Z}_{+}$ and $s\in\mathbb{R}$. Let
$G\subset\mathcal{F}^{s}(\mathbb{R}^{n})$ be a subgroup. Suppose that $f,g\in
H^{s}(\mathbb{R}^{n})$. Then

(5)
$d([f],[g])^{2}\leq\|\left\langle\xi\right\rangle^{s}(|\hat{f}|-|\hat{g}|)\|_{2}^{2}+R(n,s,G,f,g)$

where

(6)
$\begin{split}R(n,s,G,f,g)&:=\inf_{p\in[1,2],t\in\mathbb{R}}E(p,t;n,s,G,f,g),\\\
E(p,t;n,s,G,f,g)&:=c\|\chi_{A_{f\cap
g}}\left\langle\xi\right\rangle^{2s-2t}\|_{\frac{p}{2-p}}\inf_{P,Q\in G}\|Pf-
Qg\|_{H^{t,p}(\mathbb{R}^{n})}^{2},\\\ c(n,p)&:=\|\mathcal{F}\|_{L^{p}\to
L^{p/(p-1)}}^{2}\leq 1.\end{split}$

The constant $c(n,p)\|\chi_{A_{f\cap
g}}\left\langle\xi\right\rangle^{2s-2t}\|_{\frac{p}{2-p}}$ is finite if
$A_{f\cap g}$ has finite measure or $s\in(-\infty,a+t)$ where
$a=-n\frac{2-p}{2p}$ (sufficient conditions).111Note that the sharp constants
for the Fourier transform are obtained in an article of Beckner from 1975
[Bec75, Theorem 1].

######  Remark 1.1.

If $G=\\{\operatorname{Id}\\}$, then
$d([f],[g])=\|f-g\|_{H^{s}(\mathbb{R}^{n})}$ on the left hand side and
$P=Q=\operatorname{Id}$ on the right hand side. See the formulation given in
Lemma 3.2.

We discuss some special cases in Remarks 1.2, 1.3 and 1.4.

######  Remark 1.2.

If $\operatorname{supp}(\hat{f})$ has finite measure, then the constant can be
chosen to be such that it does not depend on particular $g$ since $|A_{f\cap
g}|\leq|\operatorname{supp}(\hat{f})|$.

######  Remark 1.3.

If we estimate when $s,t=0$ and $G=\\{\operatorname{Id}\\}$, then we can
recover the estimate

(7)
$\|f-g\|_{2}^{2}\leq\||\hat{f}|-|\hat{g}|\|_{2}^{2}+c|\operatorname{supp}(\hat{f})\cap\operatorname{supp}(\hat{g})|^{\frac{2-p}{p}}\|f-g\|_{p}^{2}.$

If additionally $p=1$, then

(8)
$\|f-g\|_{2}^{2}\leq\||\hat{f}|-|\hat{g}|\|_{2}^{2}+(2\pi)^{-n}|\operatorname{supp}(\hat{f})\cap\operatorname{supp}(\hat{g})|\|f-g\|_{1}^{2}.$

######  Remark 1.4.

If we estimate when $G=\\{\,w\,;\,w\in S^{1}\subset\mathbb{C}\\}$, then we can
recover the estimate

(9) $\begin{split}\inf_{w\in
S^{1}}\|f-wg\|_{H^{s}(\mathbb{R}^{n})}^{2}&\leq\|\left\langle\xi\right\rangle^{s}(|\hat{f}|-|\hat{g}|)\|_{2}^{2}\\\
&\quad+c\|\chi_{A_{f\cap
g}}\left\langle\xi\right\rangle^{2s-2t}\|_{\frac{p}{2-p}}\inf_{w\in
S^{1}}\|f-wg\|_{H^{t,p}(\mathbb{R}^{n})}^{2}\end{split}$

for $p\in[1,2]$ and $t\in\mathbb{R}$. We additionally used here that
$w:f\mapsto wf$ is an isometry also on $H^{t,p}(\mathbb{R}^{n})$.

The proof of Theorem 1.1 is given in Section 3 but we outline it next. Notice
that if $f\in L^{1}(\mathbb{R}^{n})\cap L^{2}(\mathbb{R}^{n})$ is such that
the support of $\hat{f}$ has measure $L$, then

(10)
$\|f\|_{L^{2}(\mathbb{R}^{n})}^{2}=\|\hat{f}\|_{L^{2}(\mathbb{R}^{n})}^{2}\leq
L\|\hat{f}\|_{L^{\infty}(\mathbb{R}^{n})}^{2}\leq(2\pi)^{-n}L\|f\|_{L^{1}(\mathbb{R}^{n})}^{2}.$

We make a few additional steps to deal with the difference of magnitudes of
the Fourier transforms of two functions. The fractional Sobolev norm estimates
are based on typical manipulations of the related Fourier multipliers. The
inequality for the quotient distances follows from the case
$G=\\{\operatorname{Id}\\}$, and hence this basic case can be considered to be
more important.

We make a few remarks about the estimate of Theorem 1.1 as it looks similar to
the fractional Sobolev inequalities for Bessel potential spaces [Tri78] for
$q\geq p$:

  * •

If $t-s>n\frac{2-p}{2p}$, $p\in[1,2]$, $s,t\in\mathbb{R}$, then

(11) $\|f\|_{H^{s}(\mathbb{R}^{n})}\leq
C\|f\|_{H^{t,p}(\mathbb{R}^{n})}\quad\forall f\in H^{t,p}(\mathbb{R}^{n}).$

  * •

If $t-s\geq n(\frac{1}{p}-\frac{1}{q})$, $p,q\in(1,\infty)$,
$s,t\in\mathbb{R}$, then

(12) $\|f\|_{H^{s,q}(\mathbb{R}^{n})}\leq
C\|f\|_{H^{t,p}(\mathbb{R}^{n})}\quad\forall f\in H^{t,p}(\mathbb{R}^{n}).$

Recall that the embedding (11) can be proved similarly to the proof of Lemma
3.2 using first Parseval’s identity and then the Hausdorff-Young and Hölder’s
inequalities.

######  Remark 1.5.

We note that the main result with $s<a+t$ and $G=\\{\operatorname{Id}\\}$ is
almost the fractional Sobolev inequality but now there is an improvement by
the factor generated by $\chi_{A_{f\cap g}}$ in the coefficient due to the use
of the Fourier magnitude data.

######  Remark 1.6.

The case where at least one of the functions $\hat{f}$ or $\hat{g}$ has a
support of infinite measure but
$\operatorname{supp}(\hat{f})\cap\operatorname{supp}(\hat{g})$ has finite
measure gives an estimate also when the Sobolev inequalities do not directly
apply to the function $f-g$. In this case, the additional Fourier magnitude
data permits the estimate of Theorem 1.1.

###  1.2. Comparison to the work [Ste22]

We briefly recall some parts of the work [Ste22] to motivate this note. Let
$f\in L^{1}(\mathbb{R}^{n})\cap L^{2}(\mathbb{R}^{n})$ be a function with real
valued Fourier transform. Let

(13) $L=|\\{\,\xi\in\mathbb{R}^{n}\,;\,\hat{f}(\xi)\neq 0\,\\}|<\infty.$

Then for any $g\in L^{1}(\mathbb{R}^{n})\cap L^{2}(\mathbb{R}^{n})$ one has
the estimate ([Ste22, Corollary 1])

(14) $\begin{split}&\|f-g\|_{L^{2}(\mathbb{R}^{n})}\\\ &\quad\leq
2\||\hat{f}|-|\hat{g}|\|_{L^{2}(\mathbb{R}^{n})}+30\sqrt{L}\|f-g\|_{L^{1}(\mathbb{R}^{n})}+2\|\Im\hat{g}\|_{L^{2}(\mathbb{R}^{n})}.\end{split}$

See Remarks 1.2 and 1.3 for the formulations of Theorem 1.1 in the most basic
cases to make a comparison with (14).

It is said in [Ste22] that the imaginary term in (14) accounts for the
translation symmetry in the Fourier phase problem. One motivation for writing
this note is that as $L^{p}$ differences are not invariant under translations
of only one of the involved functions, this additional imaginary term coming
from the translation symmetry of the Fourier phase problem might not be really
required in the estimates of this type. Indeed, this is the case as Theorem
1.1 shows.

It is argued in [Ste22] that the constant $\sqrt{L}$ is optimal in (14) up to
the independent constant. We give a completely different proof which improves
these independent constants and also $L$ can be replaced by a sharper term
when we let the coefficient also depend on the other function $g$ (giving the
term $L$ as an upper bound independent of $g$). Furthermore, in our approach
it does not make any difference if the involved functions or their Fourier
transforms are real or complex valued. We indicate a possible direction for
future research related to the estimates of this kind: _Could methods in this
note be combined with the arguments in[Ste22] to obtain more general
inequalities than presented in [Ste22] and here?_

##  2\. Preliminaries

###  2.1. Bessel potentials

We denote $\left\langle\xi\right\rangle=\sqrt{1+|\xi|^{2}}$ for any
$\xi\in\mathbb{R}^{n}$ and let $\mathcal{S}^{\prime}(\mathbb{R}^{n})$ be the
space of _Schwartz distributions_ (i.e. tempered distributions). We denote by
$\mathcal{F}$ and $\mathcal{F}^{-1}$ the _Fourier transform_ and the _inverse
Fourier transform_ on $\mathcal{S}^{\prime}(\mathbb{R}^{n})$. We may also
write $\mathcal{F}f=\hat{f}$ when $f\in\mathcal{S}^{\prime}(\mathbb{R}^{n})$.

We can define the $L^{2}$ Sobolev spaces for any $s\in\mathbb{R}$ using the
Fourier transform of distributions as

$H^{s}(\mathbb{R}^{n})=\\{\,u\in\mathcal{S}^{\prime}(\mathbb{R}^{n})\,;\,\mathcal{F}^{-1}(\left\langle\cdot\right\rangle^{s}\hat{u})\in
L^{2}(\mathbb{R}^{n})\,\\}$

where we equip the space with the norm
$\|u\|_{H^{s}(\mathbb{R}^{n})}:=\|\left\langle\cdot\right\rangle^{s}\hat{u}\|_{2}$
as the Fourier transform is an isometry on $L^{2}(\mathbb{R}^{n})$.

We define _Bessel potential spaces_ for any $t\in\mathbb{R}$ and
$p\in[1,\infty]$ as

(15)
$H^{t,p}(\mathbb{R}^{n}):=\\{\,f\in\mathcal{S}^{\prime}(\mathbb{R}^{n})\,;\,\mathcal{F}^{-1}(\left\langle\cdot\right\rangle^{t}\hat{f})\in
L^{p}(\mathbb{R}^{n})\,\\}$

equipped with the norm
$\|f\|_{H^{t,p}(\mathbb{R}^{n})}:=\|\mathcal{F}^{-1}(\left\langle\cdot\right\rangle^{t}\hat{f})\|_{p}$.
These are Banach spaces for any $p\in[1,\infty]$ and
$\mathcal{S}(\mathbb{R}^{n})$ is dense in $H^{t,p}(\mathbb{R}^{n})$ if
$p\in[1,\infty)$. If $f\in\mathcal{S}^{\prime}(\mathbb{R}^{n})$ and $f\notin
H^{t,p}(\mathbb{R}^{n})$, then we define
$\|f\|_{H^{t,p}(\mathbb{R}^{n})}=\infty$.

######  Remark 2.1.

The norms of $H^{s}(\mathbb{R}^{n})$ and $H^{s,2}(\mathbb{R}^{n})$ as defined
here are different by a constant depending on the normalization of the Fourier
transform.

One may recall some basic facts of Bessel potentials and the related topics,
for example, from [Tri78, Hör90, Fri98, Won14].

###  2.2. Quotient distances with respect to isometry groups

It is well-known that there exist many operators $P$ such that

(16) $|\hat{f}|=|\widehat{Pf}|.$

Any such operator, not equal to the identity, breaks down the possibility for
uniqueness in the Fourier phase problem. One usually says that the following
operations are the _trivial ambiguities_ for the Fourier phase problem:

  1. (i)

the multiplication operator $f\mapsto cf(x)$ with $c\in
S^{1}\subset\mathbb{C}$.

  2. (ii)

the translation operator $f\mapsto f(x-\tau)$ with $\tau\in\mathbb{R}^{n}$.

  3. (iii)

the conjugate reflection operator $f\mapsto\overline{f(-x)}$.

It is easy to check that the above operators have the property (16). We also
remark that they all are isometries $L^{p}(\mathbb{R}^{n})\to
L^{p}(\mathbb{R}^{n})$ for any $p\in[1,\infty]$ and $H^{s}(\mathbb{R}^{n})\to
H^{s}(\mathbb{R}^{n})$ for any $s\in\mathbb{R}$. See also the recent survey
[GKR20] which discusses in detail on the uniqueness and stability of the
Fourier phase problem.

Here we define a general setting for including such obstructions of uniqueness
in the estimates. This of course leads to defining quotient distances. The
right quotient distance may depend on the context. Therefore, we build our
theory here such that it is possible to adapt into different cases.

Let us denote by $\mathcal{B}^{s}(\mathbb{R}^{n})$ the set of bijective
operators $H^{s}(\mathbb{R}^{n})\to H^{s}(\mathbb{R}^{n})$ that are additive
but not necessarily linear. Let us further denote by
$\mathcal{F}^{s}(\mathbb{R}^{n})\subset\mathcal{B}^{s}(\mathbb{R}^{n})$ the
subgroup of operators $P\in\mathcal{B}^{s}(\mathbb{R}^{n})$ with the property

(17) $|\hat{f}(\xi)|=|\widehat{Pf}(\xi)|\quad\forall\xi\in\mathbb{R}^{n}.$

It follows from Parseval’s identity that any bijective and additive
$P:H^{s}(\mathbb{R}^{n})\to H^{s}(\mathbb{R}^{n})$ with the property (17) must
be an isometry, and it is easy to check that $\mathcal{F}^{s}(\mathbb{R}^{n})$
is a group. Note that these operators do not have to be necessarily linear.
For example, the conjugate reflection operator is a conjugate-linear isometry
with the property (17).

We will make use of subgroups $G\subset\mathcal{F}^{s}(\mathbb{R}^{n})$, i.e.
subsets with the following property

  1. (1)

If $P,Q\in G$, then $P^{-1}Q\in G$.

We define the quotient space $X^{s}(G):=H^{s}(\mathbb{R}^{n})/G$ using the
equivalence $[f]=[g]$ if and only if $f=Pg$ for some $P\in G$. The space
$X^{s}(G)$ is equipped with the quotient _pseudometric_

(18) $d([f],[g]):=\inf_{P,Q\in G}\|Pf-Qg\|_{H^{s}(\mathbb{R}^{n})}.$

Since $G$ is a group, $P^{-1}\in G$ is an isometry when $P\in G$, and we have
for any $P,Q\in G$ that

(19) $\|Pf-Qg\|_{H^{s}(\mathbb{R}^{n})}=\|P^{-1}(Pf-
Qg)\|_{H^{s}(\mathbb{R}^{n})}=\|f-P^{-1}Qg\|_{H^{s}(\mathbb{R}^{n})}$

where $P^{-1}Q\in G$. The second equality was the point where we used the
additivity assumption. One can now conclude the identity

(20) $d([f],[g])=\inf_{P\in G}\|f-Pg\|_{H^{s}(\mathbb{R}^{n})}.$

In the presence of certain compactness assumptions on $G$, the pseudometric
$d$ would be a metric and $d([f],[g])=0$ if and only if $f=Pg$ for some $P\in
G$. For instance, when $G=S^{1}$ (acting as a scalar multiplication) or
finite.

See Appendix B for a simple example of how the stability of the Fourier phase
problem with respect to quotient metrics may become almost trivial if the
group $G$ is taken to be very large.

##  3\. Proof of the main theorem

###  3.1. Preparation

Let $f,g\in\mathcal{S}^{\prime}(\mathbb{R}^{n})$. Let us define the following
subsets of $\mathbb{R}^{n}$:

(21) $\begin{split}A_{f\cap
g}&:=\operatorname{supp}(\hat{f})\cap\operatorname{supp}(\hat{g}),\quad
A_{f\cup g}:=\operatorname{supp}(\hat{f})\cup\operatorname{supp}(\hat{g})\\\
A_{f\setminus
g}&:=\operatorname{supp}(\hat{f})\setminus\operatorname{supp}(\hat{g}),\quad\quad\,A_{f}:=\operatorname{supp}(\hat{f}).\end{split}$

Clearly,

(22) $\mathbb{R}^{n}=A_{f\cap g}\cup A_{f\setminus g}\cup A_{g\setminus f}\cup
A_{f\cup g}^{c}$

as a disjoint union.

If $A\subset\mathbb{R}^{n}$, we denote the charateristic function of the set
$A$ by $\chi_{A}$. We define the associated Fourier multiplier $M_{A}$ by the
formula

(23) $M_{A}:=\mathcal{F}^{-1}\circ\chi_{A}\mathcal{F}$

whenever the definition makes sense. In particularly, if $A$ is a measurable
set, then $M_{A}:H^{s}(\mathbb{R}^{n})\to H^{s}(\mathbb{R}^{n})$ is a bounded
linear map with the operator norm at most $1$ for any $s\in\mathbb{R}$.

For the sets $A_{f\cap g}$, $A_{f\cup g}$, $A_{f\setminus g}$ and $A_{f}$, we
denote the related Fourier multipliers as $M_{f\cap g}$, $M_{f\cup g}$,
$M_{f\setminus g}$ and $M_{f}$ respectively.

###  3.2. Proof of Theorem 1.1

We first state a simple estimate to be used later. The proof is rather
straightforward and thus omitted.

######  Lemma 3.1.

Let $n\in\mathbb{Z}_{+}$ and $s\in\mathbb{R}$. Suppose that $f,g\in
H^{s}(\mathbb{R}^{n})$. Then

(24)
$\|f-g\|_{H^{s}(\mathbb{R}^{n})}^{2}\leq\|\left\langle\xi\right\rangle^{s}(|\hat{f}|-|\hat{g}|)\|_{2}^{2}+\|M_{f\cap
g}(f-g)\|_{H^{s}(\mathbb{R}^{n})}^{2}.$

We can now prove our main lemma for Theorem 1.1. We also remark that Lemma 3.2
corresponds to the case $G=\\{\operatorname{Id}\\}$ in the statement of
Theorem 1.1.

######  Lemma 3.2.

Let $n\in\mathbb{Z}_{+}$, $t,s\in\mathbb{R}$ and $p\in[1,2]$. Suppose that
$f,g\in H^{s}(\mathbb{R}^{n})$ and $f-g\in H^{t,p}(\mathbb{R}^{n})$. Then

(25)
$\|f-g\|_{H^{s}(\mathbb{R}^{n})}^{2}\leq\|\left\langle\xi\right\rangle^{s}(|\hat{f}|-|\hat{g}|)\|_{2}^{2}+c\|\chi_{A_{f\cap
g}}\left\langle\xi\right\rangle^{2s-2t}\|_{\frac{p}{2-p}}\|f-g\|_{H^{t,p}(\mathbb{R}^{n})}^{2}$

where $c(n,p):=\|\mathcal{F}\|_{L^{p}\to L^{p/(p-1)}}\leq 1$.

The constant $C(n,p,s,t,A_{f\cap g}):=c\|\chi_{A_{f\cap
g}}\left\langle\xi\right\rangle^{2s-2t}\|_{\frac{p}{2-p}}$ is finite if
$A_{f\cap g}$ has finite measure or $s\in(-\infty,c+t)$ where
$c=-n\frac{2-p}{2p}$ (sufficient conditions).

###### Proof.

We have by Lemma 3.1 that

(26)
$\|f-g\|_{H^{s}(\mathbb{R}^{n})}^{2}\leq\|\left\langle\xi\right\rangle^{s}(|\hat{f}|-|\hat{g}|)\|_{2}^{2}+\|M_{f\cap
g}(f-g)\|_{H^{s}(\mathbb{R}^{n})}^{2}.$

The rest of the argument is to control the term $\|M_{f\cap
g}(f-g)\|_{H^{s}(\mathbb{R}^{n})}^{2}$.

When $p\in[1,2]$, it follows that

(27)
$\|\left\langle\cdot\right\rangle^{t}\hat{f}\|_{q}\leq\|\mathcal{F}\|_{L^{p}\to
L^{q}}\|f\|_{H^{t,p}(\mathbb{R}^{n})}$

where $q$ is the Hölder conjugate of $p$. We have by Hölder’s inequality that

(28) $\int_{A_{f\cap
g}}\left\langle\xi\right\rangle^{2s}|\hat{f}-\hat{g}|^{2}d\xi\leq\|\chi_{A_{f\cap
g}}\left\langle\xi\right\rangle^{2s-\delta}\|_{p^{\prime}}\|\left\langle\xi\right\rangle^{\delta}|\hat{f}-\hat{g}|^{2}\|_{q^{\prime}}$

for any Hölder conjugates $1=\frac{1}{p^{\prime}}+\frac{1}{q^{\prime}}$ and
any $\delta\in\mathbb{R}$. We fix $\delta$ later so that we may estimate
$\|\left\langle\xi\right\rangle^{\delta}|\hat{f}-\hat{g}|^{2}\|_{q^{\prime}}$
with the $H^{t,p}$ norm. To do so, we use the identity
$\|\left\langle\xi\right\rangle^{\delta}|\hat{f}-\hat{g}|^{2}\|_{q^{\prime}}=\|\left\langle\xi\right\rangle^{\delta/2}|\hat{f}-\hat{g}|\|_{2q^{\prime}}^{2}.$

Choose $q=2q^{\prime}$ where $q$ is the Hölder conjugate of $p$. Then we may
calculate that $p^{\prime}=\frac{p}{2-p}$. Moreover, we want that
$\delta/2\leq t$, and for our purposes the optimal choice is $\delta=2t$.
Therefore, we get the estimate

(29) $\|M_{f\cap g}(f-g)\|_{H^{s}(\mathbb{R}^{n})}^{2}\leq c\|\chi_{A_{f\cap
g}}\left\langle\xi\right\rangle^{2s-2t}\|_{\frac{p}{2-p}}\|f-g\|_{H^{t,p}(\mathbb{R}^{n})}^{2}.$

Finally, we note that $s<-n\frac{2-p}{2p}+t$ if and only if
$\|\left\langle\xi\right\rangle^{2s-2t}\|_{\frac{p}{2-p}}<\infty$. Also, if
$A_{f\cap g}$ has finite measure, then $\|\chi_{A_{f\cap
g}}\left\langle\xi\right\rangle^{2s-2t}\|_{\frac{p}{2-p}}$ is finite for any
Sobolev scales $s,t\in\mathbb{R}$ and $p\in[1,2]$. This completes the proof. ∎

We are now ready to prove our main theorem in this note.

###### Proof of Theorem 1.1.

Suppose that $p\in[1,2]$ and $t\in\mathbb{R}$. Let $P,Q\in G$. If $Pf-Qg\notin
H^{t,p}(\mathbb{R}^{n})$, then the estimate

(30)
$d([f],[g])^{2}\leq\|\left\langle\xi\right\rangle^{s}(|\hat{f}|-|\hat{g}|)\|_{2}^{2}+c\|\chi_{A_{f\cap
g}}\left\langle\xi\right\rangle^{2s-2t}\|_{\frac{p}{2-p}}\|Pf-
Qg\|_{H^{t,p}(\mathbb{R}^{n})}^{2}$

holds trivially as the right hand side is infinite (by the convention used in
this note). Hence, we may suppose that $Pf-Qg\in H^{t,p}(\mathbb{R}^{n})$
without the loss of generality.

It follows from the definition of $G$ that $|\widehat{Pf}|=|\hat{f}|$,
$|\widehat{Qg}|=|\hat{g}|$, and $A_{Pf\cap Qg}=A_{f\cap g}$. Since $Pf$ and
$Qg$ satisfy the assumptions of Lemma 3.2, we get

(31) $\begin{split}\|Pf-
Qg\|_{H^{s}(\mathbb{R}^{n})}^{2}&\leq\|\left\langle\xi\right\rangle^{s}(|\widehat{f}|-|\widehat{g}|)\|_{2}^{2}\\\
&\quad+c\|\chi_{A_{f\cap
g}}\left\langle\xi\right\rangle^{2s-2t}\|_{\frac{p}{2-p}}\|Pf-
Qg\|_{H^{t,p}(\mathbb{R}^{n})}^{2}.\end{split}$

We may now take first $\inf_{P,Q\in G}$ and then
$\inf_{p\in[1,2],t\in\mathbb{R}}$ from both sides to obtain the desired
estimate.∎

##  Appendix A On estimates using only Fourier magnitude difference data

In this appendix, we consider conditional estimates that only use the Fourier
magnitude difference data with a constant depending on one of the functions.
The main point is to illustrate that such estimates are possible, as expected,
but they seem to hold for somewhat trivial reasons. Let $r\in[0,1)$ and $h\in
H^{s}(\mathbb{R}^{n})$. We define the following two sets

(32) $X^{s}(h;r):=\\{\,g\in
H^{s}(\mathbb{R}^{n})\,;\,\|M_{h}(h-g)\|_{H^{s}(\mathbb{R}^{n})}\leq
r\|h-g\|_{H^{s}(\mathbb{R}^{n})}\,\\}.$

and

(33) $\begin{split}X^{s}(r):=\,&\\{\,(f,g)\in H^{s}(\mathbb{R}^{n})\times
H^{s}(\mathbb{R}^{n})\,;\,\\\ &\quad\|M_{f\cap
g}(f-g)\|_{H^{s}(\mathbb{R}^{n})}\leq
r\|f-g\|_{H^{s}(\mathbb{R}^{n})}\,\\}.\end{split}$

The parameter $r$ measures how much the functions $f$ and $g$ are disjoint in
the suitable $H^{s}$ sense. We will also calculate the value of $r$ for each
given pair of functions in the end. We omit the proofs in this section as
those are rather elementary.

######  Lemma A.1.

Let $n\in\mathbb{Z}_{+}$, $s\in\mathbb{R}$ and $r\in[0,1)$. Let $f\in
H^{s}(\mathbb{R}^{n})$. If $g\in X^{s}(f;r)$, then

(34) $\|f-g\|_{H^{s}(\mathbb{R}^{n})}^{2}\leq
C\|\left\langle\xi\right\rangle^{s}(|\hat{f}|-|\hat{g}|)\|_{2}^{2}.$

where $C=1/(1-r^{2})$. The same estimate holds for the pairs of functions
$(f,g)\in X^{s}(r)$.

We next consider when such $r\in[0,1)$ exists and how to estimate $r$. We
first remark that if
$\operatorname{supp}(\hat{f})=\operatorname{supp}(\hat{g})$, then the
inequality associated with $X^{s}(f;r)$ or $X^{s}(r)$ holds only if $r=1$, and
one cannot use this simple argument to obtain the estimate (34). The content
of the next lemma is that such an estimate always holds if
$\operatorname{supp}(\hat{f})\neq\operatorname{supp}(\hat{g})$.

######  Lemma A.2.

Let $n\in\mathbb{Z}_{+}$ and $s\in\mathbb{R}$. Let $f,g\in
H^{s}(\mathbb{R}^{n})$ be such that
$\operatorname{supp}(\hat{f})\neq\operatorname{supp}(\hat{g})$. Then for any
$r\in[r_{0},1)$ it holds that $(f,g)\in X^{s}(r)$ where

(35) $r_{0}=\sqrt{1-\frac{\|M_{f\setminus
g}f\|_{H^{s}(\mathbb{R}^{n})}^{2}+\|M_{g\setminus
f}g\|_{H^{s}(\mathbb{R}^{n})}^{2}}{\|f-g\|_{H^{s}(\mathbb{R}^{n})}^{2}}}.$

Moreover, $(f,g)\notin X^{s}(r)$ when $r\in[0,r_{0})$.

One could derive similar estimates for the spaces $X^{s}(f;r)$ and
$X^{s}(g;r)$ but we will omit this.

######  Remark A.1.

Let $n\in\mathbb{Z}_{+}$ and $s\in\mathbb{R}$. Let
$G\subset\mathcal{F}^{s}(\mathbb{R}^{n})$ be a subgroup. If $f,g\in
H^{s}(\mathbb{R}^{n})$ are such that
$\operatorname{supp}(\hat{f})\neq\operatorname{supp}(\hat{g})$, then Lemmas
A.1 and A.2 imply

(36) $d([f],[g])^{2}\leq\frac{d([f],[g])^{2}}{\|M_{f\setminus
g}f\|_{H^{s}(\mathbb{R}^{n})}^{2}+\|M_{g\setminus
f}g\|_{H^{s}(\mathbb{R}^{n})}^{2}}\|\left\langle\xi\right\rangle^{s}(|\hat{f}|-|\hat{g}|)\|_{2}^{2}.$

This in fact reveals that the estimate of this type reduces to a trivial
property

(37)
$\frac{\|\left\langle\xi\right\rangle^{s}(|\hat{f}|-|\hat{g}|)\|_{2}^{2}}{\|M_{f\setminus
g}f\|_{H^{s}(\mathbb{R}^{n})}^{2}+\|M_{g\setminus
f}g\|_{H^{s}(\mathbb{R}^{n})}^{2}}\geq 1.$

One cannot even hope to do any better with this approach since the terms
$\|M_{f\setminus g}f\|_{H^{s}(\mathbb{R}^{n})}^{2}$ and $\|M_{g\setminus
f}g\|_{H^{s}(\mathbb{R}^{n})}^{2}$ are invariant under the operations by $G$.
On the other hand, when
$\operatorname{supp}(\hat{f})\to\operatorname{supp}(\hat{g})$, one easily
notes that the constant is not well-controlled even if $d([f],[g])$ is a
priori assumed to be bounded.

##  Appendix B Example of quotient distances and the Fourier phase problem

We illustrate here that the Fourier phase problem might not be mathematically
very interesting if the function space is large and the quotient distance is
taken with respect to most of the possible sources of non-uniqueness. Let us
define that $[f]=[g]$ if and only if $|\hat{f}|=|\hat{g}|$. Let the
corresponding $L^{2}$ distance be defined as
$d([f],[g])=\inf_{a}\|f-M_{a}g\|_{2}$ where $M_{a}$ is the Fourier multiplier
associated with a measurable function $a:\mathbb{R}^{n}\to S^{1}$. Note that
automatically any measurable $a$ with the range $S^{1}$ generates an $L^{2}$
Fourier multiplier keeping the Fourier magnitude data invariant.

Write

(38) $A=\\{\,\xi\in\mathbb{R}^{n}\,;\,\hat{f}(\xi)=0\text{ or
}\hat{g}(\xi)=0\,\\}.$

For any fixed $\xi\in\mathbb{R}^{n}$ with $\hat{f}(\xi)\neq 0$, one has

(39)
$|\hat{f}-\hat{g}|=|\hat{f}|^{-1}||\hat{f}|^{2}-\hat{g}\overline{\hat{f}}|$

This holds especially if $\xi\in\mathbb{R}^{n}\setminus A$. Let us therefore
define the mapping $a:\mathbb{R}^{n}\to S^{1}$ as

$a=\chi_{\mathbb{R}^{n}\setminus
A}\hat{f}|\hat{f}|^{-1}\overline{\hat{g}}|\hat{g}|^{-1}+\chi_{A}.$

Using (39), we easily obtain the identity

$\|f-M_{a}g\|_{2}=\||\hat{f}|-|\hat{g}|\|_{2}.$

Since $M_{a}$ is one of the suitable Fourier multipliers for any $f,g\in
L^{2}(\mathbb{R}^{n})$, we find eventually that

$d([f],[g])=\||\hat{f}|-|\hat{g}|\|_{2}$

holds for all $f,g\in L^{2}(\mathbb{R}^{n})$. The same principles hold of
course on $H^{s}(\mathbb{R}^{n})$.

### Acknowledgements

The author was supported by the Research Council of Finland through the
Flagship of Advanced Mathematics for Sensing, Imaging and Modelling (decision
number 359183). The author acknowledges support by the Swiss National Science
Foundation (SNF Grant 184698) and Rima Alaifari at ETH Zürich in 2020–2021.
The author is grateful to Stefan Steinerberger for comments related to this
note.

## References

  * [ADGY19] Rima Alaifari, Ingrid Daubechies, Philipp Grohs, and Rujie Yin.  Stable phase retrieval in infinite dimensions.  Found. Comput. Math., 19(4):869–900, 2019.
  * [AG17] Rima Alaifari and Philipp Grohs.  Phase retrieval in the general setting of continuous frames for Banach spaces.  SIAM J. Math. Anal., 49(3):1895–1911, 2017.
  * [AG21] Rima Alaifari and Philipp Grohs.  Gabor phase retrieval is severely ill-posed.  Appl. Comput. Harmon. Anal., 50:401–419, 2021.
  * [Aku56] Edwin J. Akutowicz.  On the determination of the phase of a Fourier integral. I.  Trans. Amer. Math. Soc., 83:179–192, 1956.
  * [Aku57] Edwin J. Akutowicz.  On the determination of the phase of a Fourier integral. II.  Proc. Amer. Math. Soc., 8:234–238, 1957.
  * [AW21] Rima Alaifari and Matthias Wellershoff.  Stability estimates for phase retrieval from discrete Gabor measurements.  J. Fourier Anal. Appl., 27(2):Paper No. 6, 31, 2021.
  * [BBE17] Tamir Bendory, Robert Beinert, and Yonina C. Eldar.  Fourier phase retrieval: uniqueness and algorithms.  In Compressed sensing and its applications, Appl. Numer. Harmon. Anal., pages 55–91. Birkhäuser/Springer, Cham, 2017.
  * [BCMN14] Afonso S. Bandeira, Jameson Cahill, Dustin G. Mixon, and Aaron A. Nelson.  Saving phase: injectivity and stability for phase retrieval.  Appl. Comput. Harmon. Anal., 37(1):106–125, 2014.
  * [Bec75] William Beckner.  Inequalities in Fourier Analysis.  Ann. of Math., 102(1):159–182, 1975.
  * [BW15] Radu Balan and Yang Wang.  Invertibility and robustness of phaseless reconstruction.  Appl. Comput. Harmon. Anal., 38(3):469–488, 2015.
  * [CCD16] Jameson Cahill, Peter G. Casazza, and Ingrid Daubechies.  Phase retrieval in infinite-dimensional Hilbert spaces.  Trans. Amer. Math. Soc. Ser. B, 3:63–76, 2016.
  * [CDDL20] Cheng Cheng, Ingrid Daubechies, Nadav Dym, and Jianfeng Lu.  Stable phase retrieval from locally stable and conditionally connected measurements, 2020.
  * [CF83] T. R. Crimmins and J. R. Fienup.  Uniqueness of phase retrieval for functions with sufficiently disconnected support.  J. Opt. Soc. Amer., 73(2):218–221, 1983.
  * [Fie82] J. R. Fienup.  Phase retrieval algorithms: a comparison.  Appl. Opt., 21(15):2758–2769, Aug 1982.
  * [Fri98] F. G. Friedlander.  Introduction to the theory of distributions.  Cambridge University Press, Cambridge, second edition, 1998.  With additional material by M. Joshi.
  * [GKR20] Philipp Grohs, Sarah Koppensteiner, and Martin Rathmair.  Phase retrieval: uniqueness and stability.  SIAM Rev., 62(2):301–350, 2020.
  * [GR19] Philipp Grohs and Martin Rathmair.  Stable Gabor phase retrieval and spectral clustering.  Comm. Pure Appl. Math., 72(5):981–1043, 2019.
  * [GR22] Philipp Grohs and Martin Rathmair.  Stable Gabor phase retrieval for multivariate functions.  J. Eur. Math. Soc., 24(5):1593–1615, 2022.
  * [Hof64] E. Hofstetter.  Construction of time-limited functions with specified autocorrelation functions.  IEEE Transactions on Information Theory, 10(2):119–126, 1964.
  * [Hör90] Lars Hörmander.  The Analysis of Linear Partial Differential Operators I.  Springer-Verlag, second edition, 1990.
  * [IMP19] Mark A. Iwen, Sami Merhi, and Michael Perlmutter.  Lower Lipschitz bounds for phase retrieval from locally supported measurements.  Appl. Comput. Harmon. Anal., 47(2):526–538, 2019.
  * [KST95] Michael V. Klibanov, Paul E. Sacks, and Alexander V. Tikhonravov.  The phase retrieval problem.  Inverse Problems, 11(1):1–28, 1995.
  * [Ste22] Stefan Steinerberger.  On the stability of Fourier phase retrieval.  J. Fourier Anal. Appl., 28(2):29, 2022.
  * [Tri78] Hans Triebel.  Interpolation Theory, Function Spaces, Differential Operators.  North-Holland Publishing Company, 1978.
  * [Wal63] Adriaan Walther.  The question of phase retrieval in optics.  Optica Acta, 10:41–49, 1963.
  * [Won14] M. W. Wong.  An Introduction to Pseudo-Differential Operators.  World Scientific, third edition, 2014.