text:
Building and Design
Legrand Assisted Living & Healthcare support local initiative to tackle isolation
Facilities | Mental Health | Patient Experience
Whitehouse Farm Centre near Morpeth has launched a new initiative which aims to encourage new friendships and tackle isolation through a regular programme of events and social activities
Hay Days launch
With support from local company Legrand Assisted Living & Healthcare, based in Blyth, the farm launched 'Hay Days' on 8 May with a tea dance and welcomed over 80 service users, including their carers from a number of care homes and community groups in Northumberland and Tyneside.
Dawn Peters, the events coordinator at Whitehouse Farm Centre, said: "The aim of Hay Days is to bring isolated community groups, people living in sheltered accommodation and care homes across the region together to take part in weekly and monthly activities which encourage new friendships and tackle isolation through fun, social events hosted on the farm.
The feedback we have received has been phenomenal and clearly demonstrates there is a need for this type of service in the community."
"Even though some experience physical or mental infirmities, age should not be a barrier to meeting people and enjoying new experiences. The feedback we have received has been phenomenal and clearly demonstrates there is a need for this type of service in the community."
Attendees at the Victory Europe (VE) Day-themed launch danced and sang along with talented vintage singing sensation Kayley Cares from Sunderland. They were then treated to a tasty lunch by the farm's catering team which was followed by a tour of the farm.
Residents came from Scarbrough Court Care Home in Cramlington, Mind Active Northumberland, Frank Bushell House in South Shields and The Caddy Shacks, a group covering Northumberland and Tyneside which brings adults with learning disabilities and physical disabilities together for trips and activities to help them make new friends and integrate with the local community.
June Shone, coordinator for The Caddy Shacks, said: "We had a great day at Whitehouse Farm. Hay Days is a fantastic idea, everyone in our group said what a fantastic day out and how brilliant the organisation was. It was great to see so many people from different groups get up and dance and mix with one another. I'd like to thank the team at Whitehouse Farm, who were lovely, so friendly and helpful and wish them every success with Hay Days."
To minimise the cost of running Hays Days events, Whitehouse Farm is receiving support from Legrand Assisted Living & Healthcare. The company designs, manufactures and supplies innovative technology solutions for the supported housing, health and social care sectors through their Tynetec, Jontek and Aid Call brands.
Managing Director for Legrand Assisted Living & Healthcare, Chris Dodd, explains: "We are delighted to be involved in this fantastic initiative. Hay Days aims to tackle many of the key issues that are prevalent within our market, given that our products and services are designed to empower individuals to be safe, happy and independent in their own environments.
"Without a safe and friendly environment, many of the most vulnerable members within our community experience loneliness and isolation. As we are a Northumberland-based company that has been designing and manufacturing products in Blyth for over 40 years, we are fully invested in tackling the lack of activities available to combat loneliness in our local area, which is why we are working in partnership with Whitehouse Farm to support an event that is providing a much-needed social environment for elderly people to enjoy."
Legrand Electric
Quartz partners with Aid Call to deliver new build hospital
Nurse Call when it's needed most
Dementia-friendly ward opens at St Mary's Hospital
Artwork for older people at Doncaster and Rotherham hospitals
Designers work to improve mental health facilities at Forth Valley Royal Hospital
Related Product News
Bradford Royal Infirmary
Nurse call with bed status monitoring
Introducing The Touchsafe Pro
About HPCi Media
About Building Better Healthcare
Awards Website


The Presidency: The Role(s) of the Chair in European Union Negotiations.
EU som ledare i multilaterala förhandlingar: en strävan med förhinder?
Leader or Foot-Dragger? Perceptions of the European Union in International Multilateral Negotiations.
Regional Organizations and International Mediation: The Effectiveness of Insider Mediators.
Development and democracy. What have we learned and how?
Den politiska utmaningen - nationella och europeiska intressen i konflikt?
Negotiations in the EU: Bargaining or problem-solving?
Vad utgör ett lyckat ordförandeskap?


text:
Q: Failed create table I fail all the CREATE TABLE; and INSERT statements with the error no such a table.
This does not happen with Android 2.3. Instead it with a 3.2. Why is that? Error creating the database?
My class example:
public class MainActivity extends Activity {

DatabaseHelper databaseHelper = new DatabaseHelper(this);

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

    String queryTest="create table TEST_TABLE(ID integer,T_MESSAGE text)";
    databaseHelper.executeQuery(queryTest);
    queryTest="INSERT INTO TEST_TABLE (ID,T_MESSAGE) VALUES (1,'1');";
    databaseHelper.executeQuery(queryTest);

}

}
My database:
public class DatabaseHelper extends SQLiteOpenHelper {

private static String DATABASE_NAME = "pro.db";
private static String DATABASE_PATH = "/data/data/it.sysman.mobile.contactpro/databases/";

private static final int SCHEMA_VERSION = 2;

public DatabaseHelper(Context context) {
    super(context, DATABASE_NAME, null, SCHEMA_VERSION);
}

@Override
public void onCreate(SQLiteDatabase sqlDB) {
    try {

    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    // TODO Auto-generated method stub

}
private SQLiteDatabase openDataBase(int flag) {

    SQLiteDatabase checkDB = null;

    try {

        Environment.getExternalStorageDirectory();
        Environment.getDataDirectory();
        Environment.getRootDirectory();
        Environment.getExternalStorageState();
        checkDB = getWritableDatabase();

    } catch (Exception e) {
        e.printStackTrace();
    }

    return checkDB;
}

public String executeQuery(String query) {

    SQLiteDatabase sqlDB = null;
    Cursor data = null;
    try {
        sqlDB = openDataBase(SQLiteDatabase.NO_LOCALIZED_COLLATORS);
        data = sqlDB.rawQuery(query, null);

        if (data.getCount() == 0)
            return null;

    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (data != null)
            data.close();
        if (sqlDB != null)
            sqlDB.close();
    }
    return null;
}

}

A: there are a number of remarks here:
One:
If you insist on creating the database outside of SQLiteOpenHelper. then use execQuery() and not rawQuery(). I don't know if this will solve the issue, but this is the method you should use for sql queries that does not return results.
Two:
It is prefered to do the creation of your database inside the SQLiteOpenHelper and let it manage the creation and updating of your database.
see this blog post if you want to use a pre-loaded database with your application.

redpajama_set_name: RedPajamaStackExchange


text:
Thank You, Uruguay
Posted by Martin Longman | Jul 17, 2014 | Uncategorized | 2 |
Everyone should clap for Uruguay which has agreed to take six of our prisoners held at the detention facility at Guantanamo Bay, Cuba.
The men — four Syrians, a Palestinian and a Tunisian — are among the more than 70 detainees who have long been cleared for release from the U.S. detention facility because they are not deemed an ongoing threat. The move would mark a significant step in the Obama administration's long-stymied quest to shut down Guantanamo Bay, where 149 inmates remain.
A congressional aide who spoke on the condition of anonymity said key lawmakers were notified about the imminent transfer last Thursday. None has publicly criticized the proposal. By law, the Pentagon must notify members of Congress of its intention to release Guantanamo Bay inmates at least 30 days in advance.
The men's move to Uruguay would be the first release from the prison since the Obama administration incensed lawmakers in May by freeing five Afghan detainees in exchange for Army Sgt. Bowe Bergdahl, who had been held by the Taliban for five years, without notifying them.
People should pause and think about this:
The Uruguayan Embassy in Washington declined to comment on the timing of the release. Uruguayan President José "Pepe" Mujica told The Washington Post in an interview in May that his government had agreed to take in the detainees, but was urging the Obama administration to move quickly.
"It can't be too long," he said. "I only have a few months of government left."
Mujica, a former guerrilla leader, said he felt a measure of kinship with the inmates at Guantanamo Bay, having been locked up for 13 years during a period of military rule.
There is a wide gulf between how most Americans view themselves and how they perceived by the rest of the world. This is a perfect example of that.
PreviousDid They Do This On Purpose?
NextCalifornia's Death Penalty Unconstitutional
Tough Love for the Vatican?
Wednesday News Bucket
My Kid has Brown Skin too
CLOSED Froggy Bottom Cafe 24/7

redpajama_set_name: RedPajamaCommonCrawl


We always use our best efforts to ensure the physical, mental and emotional safety of our clients, our co-facilitators and the horses we work with.
Interacting with horses in equine facilitated learning can bring life-changing insights. Horses are at the heart of what we do; they are equal partners and co-facilitators in our programmes. Our role as facilitators is to create and hold the space for the horses to work their magic.
Wherever possible we work with horses at liberty; if we work with horses on lead ropes, delegates are instructed to keep the rope slack and not pull on it.
We do not work with horses in round pens or in other confined spaces, to avoid putting horses under pressure. We do not use driving / send-away dominance-based exercises. Personal boundary and assertiveness issues are explored through respectfully asking horses to back-up, move sideways etc.
We respect horses' needs for friends (equine companions), freedom (living out / turnout) and forage (grazing). Our model delivers principally at equine facilities with other people's horses; our aim is that their experience in working with us is always a positive complement to their usual daily activities.
Our philosophy is one of trust, respect and co-operation – with our horses, our colleagues and our clients. We do not subscribe to any particular system of horsemanship; we are open to learning from those with whom our values are aligned.


The post Hello world! appeared first on Hoi An Roastery.
The post Why You Will Love a Family Holiday at Aore Island Resort Vanuatu! appeared first on Wanderlust Storytellers | Family Travel Blog | Travel with Kids | Travel Tips.
The post Full day Meeting package appeared first on Boutique Hoi An Resort | Ancient Charm And Modern Living.
Hoi An is a perfect little riverside town with a lot of eateries to choose from and tons of great food. Learn about the best places to eat here.
Discover the charming coastal town of Hoi An in south Vietnam and find out where to eat, sleep and drink with this super simple and informative city guide.
The post STAY 4 PAY 3 appeared first on Boutique Hoi An Resort | Ancient Charm And Modern Living.
The post Hoian Garden Palace Slider 03 appeared first on Hoi An Garden Palace.
The post Is it a Good Idea to Travel to Antarctica with Kids? appeared first on Wanderlust Storytellers | Family Travel Blog | Travel with Kids | Travel Tips.
The post Tra Que village's vegetables add value to exalted Hoi An cuisine appeared first on Hoi An Garden Palace.
The post Escape the heat with these indoor recipes appeared first on Old Town Bar and Bistro.
Welcome to Hoa Hien restaurant!
Welcome to Hoa Hien restaurant in Hoi An Ancient Town! Only 5 minutes cycling from the Center of Old Quarter.
The post SAVE 20% DISCOUNT appeared first on Boutique Hoi An Resort | Ancient Charm And Modern Living.
The post Hello world! appeared first on Old Town Bar and Bistro.
The post Hoian Garden Palace Slider 02 appeared first on Hoi An Garden Palace.
The post HOI AN CITY appeared first on Hoi An Garden Restaurant.
The post MERRY CHRISMAS AND HAPPY NEW YEAR 2016!!! appeared first on Hoi An Garden Restaurant.
The post Hoian Garden Palace Slider 05 appeared first on Hoi An Garden Palace.
The post Hoian Garden Palace Slider 04 appeared first on Hoi An Garden Palace.
The post Deluxe Honeymoon package appeared first on Boutique Hoi An Resort | Ancient Charm And Modern Living.
The post The foodies guide to the Sunshine Coast appeared first on Adventures of Soph.
The post Espresso coffees appeared first on Hoi An Roastery.
The post USA restaurants launches menu written in emojis appeared first on Old Town Bar and Bistro.
The post Freshen Up Your Walls With Creative Mobile Book Illustrations! appeared first on Hoi An Roastery.
An informative post on Hoi An Ancient town. What to expect, top things to do in Hoi An Old Town, where to eat & where to stay! Such an enchanting town!
The post Soph's Travel Diary: Roadtrip to Byron Bay appeared first on Adventures of Soph.
The post Sundays of gluten-free pizzas appeared first on Old Town Bar and Bistro.
The post Six Vietnam's most interesting destinations in the world appeared first on Hoi An Garden Palace.
The post Boutique Spa package appeared first on Boutique Hoi An Resort | Ancient Charm And Modern Living.
The post Looking for an Luxurious and Affordable Airbnb on the Sunshine Coast? appeared first on Wanderlust Storytellers | Family Travel Blog | Travel with Kids | Travel Tips.
The post Healthy recipes for summer appeared first on Old Town Bar and Bistro.
Banh xeo Hoi An differs from the one in Saigon. But how? Here's what you need to know.
The post 4 great things to do in Hoi An that you may not know about appeared first on Hoi An Garden Palace.
The post Account Creation, Standalone Mobile Websites, And Dealing With Non-UX Designers appeared first on Hoi An Roastery.
The post Hoian Garden Palace Slider 01 appeared first on Hoi An Garden Palace.
The post HOI AN ROASTERY PHOTO CONTEST appeared first on Hoi An Roastery.
Hoi An Roastery - Japanese Bridge Our original location, in the middle of the Ancient Town, just moments from the Japanese bridge. Enjoy your coffee while sitting upstairs or downstairs, with views of the street or privacy to chat, get some work done or write some letters home!
Located in the Minh An neighborhood in Hoi An, 15 miles from Da Nang, Sunset Hoi An Hotel features a restaurant and free WiFi.
Hoi An Motorbike Street Food Half Day, a trip itinerary to Hoi An, Vietnam, Hoi An Food tour focus on street food which you would not get if you were just a tourist walking around by yourself. You will discover some hidden Hoi An streets at the back of the tour guides 'motorbikes. The enthusiastic tour guides will show you best place to eat with Hoi An styles of eating as well as offer much insights to the street food than meets the eyes. This is a foodie tour so make sure that you join with your empty stomach.
The post Smoothies appeared first on Hoi An Roastery.
The post Hoi An appeared first on Hoi An Garden Restaurant.
The post Building Something That Your Users Will Actually Want To Buy appeared first on Hoi An Roastery.
The post One Day In Colmar France: Colmar Itinerary + Printable Map appeared first on Almost Landing.
The post Soph's Travel Diary: Climbing Mt. Ngungun appeared first on Adventures of Soph.
The post Hole in one Golf package appeared first on Boutique Hoi An Resort | Ancient Charm And Modern Living.
EXPLORE THE RICH HERITAGE OF HOI AN AT BOUTIQUE HOI AN RESORT. DISCOVER AUTHENTIC VIETNAMESE CUISINE AND HOSPITALITY.
The post How To Get The Most Out Of A Premium WordPress Theme appeared first on Hoi An Roastery.
The post Half day Meeting package appeared first on Boutique Hoi An Resort | Ancient Charm And Modern Living.
The post SPECIAL DEALS appeared first on Boutique Hoi An Resort | Ancient Charm And Modern Living.
Essential Turkey Travel Advice & Travel Tips that you SHOULD Know!
The post Essential Turkey Travel Advice & Travel Tips that you SHOULD Know! appeared first on Wanderlust Storytellers | Family Travel Blog | Travel with Kids | Travel Tips.
The post Discover India like Never Before with your Kids and Family appeared first on Wanderlust Storytellers | Family Travel Blog | Travel with Kids | Travel Tips.
The post The7's review: cheep, but not cheap appeared first on Old Town Bar and Bistro.
House of Hoi An is not your typical pho joint.
Some of my favourite Vietnamese dishes and Vietnamese food experiences can be found in Hoi An. Here are our favourite Hoi An Street Food picks.
Compare prices and find the best deal for the Almanity Hoi An Wellness Resort. Rates from $95. Save up to 25% on Hotels with KAYAK now!
The post Discover Hoi An package appeared first on Boutique Hoi An Resort | Ancient Charm And Modern Living.


I noticed that there isnt a DZC Version for Battlescribe.
I had some spare time so I started working on a Version.
It should be possible to adept DZC for Battlescribe, however one thing could be a problem: I didnt find a way to set the 33% rule for the battlegroups because there is no direct function for that.
It could be working with the Incremention function but I'm not sure atm (I will check that).
Would there be interest in that project?
And are here people who can work with the Battlecribe Catalogue Editor and have time?
How is the IP Situation with model special Rules? Is it allowed to implement these special rules (like the Ares Scanner Array or Apollos special rules) into Battlescribe or only the book/page reference?
1. I couldn't set the 33% (50% in Skirmish) threshold.
2. I didn't find an elegant way to set the limitations on Gates.
In addition, the coding for dropship rules wasn't pretty.
Problem 1: You can limit the max. points of an entry. If you increase the max. point value by 1 for every 3 points in your army (=33 %) that should do the trick.
Problem 2: You can select not more then 1 gate per squad? If there isn't an elegant way, then you have to take the inelegant way I bet there is a solution for that.
I was working in an older version, but when I tried setting the % maximum, it was sharing it across all battlegroups of s specific type (ex you have two armor battlegroups, together they couldn't be more than 33%).
Gates have the issue where your total Gate value is limited by total Mass value. It may have been a restriction n the version I was working off of, but I couldn't find a way to test against the restrictions.
I'm working on an update. I don't know when it will be finished though.
Solved the 33% HQ thing but have some diffilculty with the Shaltari Gates.
Especialy after Restructuring the army that I don't need to update everything 3 times by making shared entries.
I shall take an other look at the gate situation.
Resistance is added and finished.
PHR add famous commander effects.
Where do the database files live?
the more info you give me the better I can check it and remove it.


text:
Correction to: Renal complications in coronavirus disease 2019: a systematic review
Taichiro Minami1,2,
Yasunori Iwata2 &
Takashi Wada2
Inflammation and Regeneration volume 41, Article number: 24 (2021) Cite this article
The Original Article was published on 15 December 2020
Correction to: Inflamm Regener 40, 31 (2020)
Following publication of the original article [1], the authors reported an update in reference number 40.
The original reference number 40 is:
40. Kashi AH, Fallah-Karkan M, Amini E, Vaezjalali M. The presence of COVID-19 in urine: a systematic review and meta-analysis of the literature. medRxiv. 2020. https://doi.org/10.1101/2020.05.15.20094920.
The updated reference number 40 is:
40. Kashi AH, De la Rosette J, Amini E, Abdi H, Fallah-Karkan M, Vaezjalali M. Urinary Viral Shedding of COVID-19 and its Clinical Associations: A Systematic Review and Meta-analysis of Observational Studies. Urol J. 2020 Sep 5;17(5):433–441. doi: https://doi.org/10.22037/uj.v16i7.6248. PMID: 32888186.
The original article [1] has been updated.
Minami T, Iwata Y, Wada T. Renal complications in coronavirus disease 2019: a systematic review. Inflamm Regener. 2020;40:31 https://doi.org/10.1186/s41232-020-00140-9.
Renal Division, Department of Medicine, Brigham and Women's Hospital, 4 Blackfan Street, Boston, MA, USA
Taichiro Minami
Department of Nephrology and Laboratory Medicine, Kanazawa University, Kanazawa, Ishikawa, Japan
Taichiro Minami, Yasunori Iwata & Takashi Wada
Yasunori Iwata
Takashi Wada
Correspondence to Taichiro Minami.
Minami, T., Iwata, Y. & Wada, T. Correction to: Renal complications in coronavirus disease 2019: a systematic review. Inflamm Regener 41, 24 (2021). https://doi.org/10.1186/s41232-021-00171-w
DOI: https://doi.org/10.1186/s41232-021-00171-w


There are many more choices today on the market of organic gardening products. In today's health conscious world, organic foods are no longer for the eccentric old ladies who love to grow their own vegetables. Organic foods can be found in grocery stores all over the country, as well as finding some grocery stores in almost every town that specializes in organic foods. Now it is not just the local farmers market (which by the way may or may not be organic) that sells these fresh foods, they are readily available in many venues. However, the price of these foods drastically increases the food bill if a family decides to start eating organic. As such some people are turning to organic gardening as a means to eat healthy and stay within a budget.
There are different organic gardening products that are needed to make an organic garden. The first step to gardening is to prepare the soil, so one organic gardening product that is needed is a simple hoe and shovel. By using these tools, the gardener can break up the soil in order to aerate it and prepare it for the next step in organic gardening, adding nutrients to the soil.
There are different ways to add nutrients, but one of the best ways is to add mulch, which can be bought out of an organic gardening product catalogue. This mulch is made from decaying leaves and other materials that are high in nutrients for new plants. If the soil in the garden is especially sandy, then it probably does not hold nutrients well and is lacking in the things needed for a garden to grow well.
Organic gardening compost is one way to avoid having to buy mulch through an organic gardening product catalogue or store. This does take some planning ahead, since the compost pile has to have time to decompose in order for the soil beneath it to reach its full capacity of minerals for the garden. The process does move very quickly however, and within a couple of weeks, nice mulch can be found under the compost pile. If that pile is added to on a regular basis, then there will always be mulch available to add to the garden.
Once the soil is prepared, then it is time for the next organic gardening product, the one that, without which, there would not be a garden at all: seeds. Organic gardening product catalogues and stores all carry a vast array of seeds, certified to be organic. With great soil and a bunch of seeds, the organic gardener is on her way to a feast!


text:
\section{Introduction}
Clique is a subgraph of an undirected graph, where every distinct vertices in the subgraph are connected via an edge; that is, subgraph is complete. \textit{k}-clique problem is a subset of clique problem which determines whether an arbitrary graph contains a clique of size \textit{k}. Various branches of computer science uses clique finding problems in pattern recognition\cite{8}, information retrieval\cite{1}, community detection \cite{2},\cite{3},\cite{4}, computer vision \cite{8} and analysis of financial networks \cite{9}. Clique finding problem is also used in the field of spatial data mining \cite{5}, data mining in bio-informatics\cite{6} and disease classification \cite{7}.
  Karp and Cook showed that \textit{k}-clique problem is NP-complete. Most commonly studied \textit{k}-clique problem is 3-clique problem or triangle finding problem. It is easy to show that the randomized classical query complexity of \textit{3}-clique is $O(n^2)$ where n denotes the number of vertices in the graph\cite{40}. Szegedy constructed a quantum algorithm for \textit{3}-clique problem with query complexity $O(n^\frac{10}{7})$\cite{37}. Later, Magniez et al. showed, \textit{3}-clique problem can be solved with improved query complexity $O(n^\frac{13}{10})$ using quantum walk approach \cite{33}. To date, the best known lower bound on the quantum query complexity of \textit{3}-clique is
$\Omega(n)$ and the best known algorithm has a complexity of $O(n^\frac{5}{4})$ \cite{38}\cite{39}.\par Maximum Clique Problem(MCP) aims at finding a complete subgraph of a graph with maximum cardinality. In 2015, Pronaya Prosun Das et al. used the concept of quantum inspired evolutionary algorithm  proposed by Kuk-Hyun Han et al\cite{14} for solving the Maximum Clique Problem. Quantum inspired evaluation algorithm is a combination of quantum computing and evolutionary algorithm. \cite{16} Elijah Pelofske et al. proposed quantum annealer for solving the Maximum Clique Problem \cite{16}. Several advancement in the experimental implementations \cite{11},\cite{12},\cite{13} of quantum computation has grown interest among the researchers to work in quantum computing. Solution of clique problem using quantum computing is more efficient in terms of computation compared to its classical counterpart as a  superposition of all vertices can provide functional parallelism in executing the quantum search process. Quantum circuit design for \textit{k}-Clique Problem can be formulated in a generic way instead of a specific case, so that different circuit instances of the same can be used for applications in the quantum domain. The objective of this work is to synthesize the circuit of \textit{k}-Clique Problem in binary quantum system for the first time using Classical-Quantum Hybrid approach\cite{17} by using the decision oracle and the Grover's diffusion operator. The proposed hybrid algorithm generates the QASM(Quantum Assembly Language) file for any given unweighted and undirected graph. The oracle block marks the searched state by inverting its amplitude, diffusion operator amplifies the amplitude of the searched state and after $O(\sqrt{N})$ number of iterations the amplitude of the searched state will be maximum, while the amplitude of the other states will be reduced to almost zero. Using this approach generalized algorithm for the Maximum Clique Problem has been proposed in this paper. The algorithm has been implemented on arbitrary graph instances and has been simulated in real quantum devices like NISQ devices. NISQ technology is pioneered by J. Preskil \cite{36}, which provides a tangible quantum programming environment and is serving as a milestone for the large-scale universal quantum computers of the future.

\par\par

\par Our key contributions in this paper can be summarized as follows:
\begin{itemize}

\item We have proposed a generalized algorithm for solving the \textit{k}-clique problem, which is an extension of Grover's algorithm and based on a newly defined auto generated oracle.
\item Further we have reduced complexity of the proposed algorithm which is $O(\sqrt{2^{k*log_2n}})$ for a graph with \textit{n} number of nodes and \textit{k} sized clique as compared to classical counterpart with complexity $O(2^n)$.
\item We have implemented the generalized algorithm on arbitrary graph instances and simulated the same in NISQ devices (IBMQX architecture [24],[7] ) through a python based programming interface called QISKit[23].

\end{itemize}

\par The paper has been organized as follows. \textbf{Section II} explains about related work in classical and quantum domain. Generalized algorithm for synthesis of \textit{k}-Clique Problem has been discussed in \textbf{Section III}. The extension of the algorithm for solving MCP has also been given in this section. \textbf{Section IV} deals with the circuit construction of some arbitrary graph with different clique sizes. Mathematical formulation of the algorithm has been detailed out in \textbf{Section V}. The performance of the circuit has been analyzed in \textbf{Section VI} . \textbf{Section VII} deals with experimental results of the circuit in the IBMQ simulator. Complexity of the algorithm has been analyzed in \textbf{Section VIII}. The paper concludes with a summary and future scope in \textbf{Section IX}.

\justify
\section{Background}
Quantum mechanical computers were proposed in the early 1980s and the description of quantum mechanical computers were formalized in the late 1980s. Many efforts on quantum computers have progressed actively since the early 1990s because these computers were shown to be more powerful than classical computers on various specialized problems. Several quantum algorithms, for example \textbf{Shor's Algorithm}\cite{31} for factoring integers,  \textbf{Grover's Algorithm}\cite{32} for searching an unstructured database, \textbf{Triangle finding} by Magniez et al. \cite{33}, \textbf{Matrix Product Verification}\cite{34}, \textbf{Group Commutavity Testing} have already been proposed. Solution of \textit{k}-Clique Problem in classical domain using brute force techniques may be expensive as the complexity of the algorithm increases exponentially with the increasing number of vertices. In this paper, a generalized algorithm for synthesis of \textit{k}-Clique Problem has been proposed in quantum domain where a combinatorial approach has been used with the help of Grover's algorithm. A generic algorithm for the Maximum Clique Problem has also been proposed using the approach.
\paragraph{\textbf{Grover's Algorithm}:} Grover's algorithm\cite{32} is a way of finding an element in an unsorted list with N elements using quantum computers. Grover's algorithm is based on amplitude amplification of the base state which specifies a position of a searched element in the list. It runs in time O$(\sqrt{N} )$ where N is the number of elements in the list. The generalized structure of Grover's algorithm is shown in Fig 1.

\par More elaborately, The steps of the Grover's algorithm are as follows:

\begin{figure}[h]
\centering
\includegraphics[width=80mm,height=4.0cm]{groversalgo.eps}
\fcaption{Generalized Circuit for Grover's algorithm\cite{32}}
\end{figure}
\par \textbf{Initialization}: The algorithm starts with the uniform superposition of all the basis states on input qubits $n$. The last ancilla qubit is used as an output qubit which is initialized to $H \ket1$. Thus, we obtain the quantum state $\ket \psi$.

\textbf{Sign Flip}: Flip the sign of the vectors for which $U_{f}$ gives output 1.

\textbf{Amplitude Amplification}: We need to perform the inversion about the average of all amplitudes of quantum state for a certain number of iterations to get the amplitude of the marked state large enough, so that it can be obtained from a measurement with probability close to 1. This phenomenon is known as amplitude amplification which is performed by using diffusion operator.

\textbf{Number of Iterations}: Iterations of Grover's algorithm is the number of times that the Oracle and Amplification stages are performed.
Each iteration of the algorithm increases the amplitude of the marked state by $O(\sqrt{1/N})$. In this way, Grover's search algorithm requires $\sqrt{N/M}$ many iterations to get the probability of one of the marked states $M$ out of total $N$ number of states set. If the number of iterations of Grover's algorithm are more than the optimal number, the probability of measuring the desired state actually goes down which further reduces the chances of success.
Therefore, right number of iterations is important for getting the proper result.
\par{\textbf{Diffusion operator}}:
This diffusion operator of Grover's algorithm \cite{32} inverts the amplitude of the input states about their mean value of amplitude. The matrix representation of the diffusion operator is shown in Fig 2.
\begin{figure}[h]

\[\left(\begin{array}{cccc}
-1 + \frac{2}{N} & \frac{2}{N} & ... & \frac{2}{N}\\
\frac{2}{N} & -1 + \frac{2}{N} & ... & \frac{2}{N}\\
... & ... & ... & ...\\
\frac{2}{N} & \frac{2}{N} & ... & \ -1 + \frac{2}{N}
\end{array}\right)\]
\fcaption{Generalized Diffusion Operator}
\end{figure}
The functional view of Grover's Search Algorithm is presented here.
 $\exists$ function Oracle(O) such that

\[
   						 O\ket{x}=
							\begin{cases}
    							-\ket{x},& \text{if \textit{x} is Marked}\\
                                 \ket{x},              & \text{otherwise}
\end{cases}
\]
\par In the next subsection, key concepts related to the paper have been introduced.
\justify
\subsection{Key Concepts}

 This subsection deals with the definition of a clique, \textit{k}-clique, maximum clique of a graph, quantum oracle and query, which have been used in the rest of the paper. \par
\paragraph{\textbf{Clique, \textit{k}-clique and maximum clique:-}} Clique in an undirected graph is a sub graph that is complete. Particularly, if there is a subset of \textit{k} vertices that are connected to each other, we say that graph contains a \textit{k}-clique.
 \begin{figure}[h]
\centering
\includegraphics[width=1in]{cliqueex.png}

\fcaption{An arbitrary graph}

\end{figure}
 Let \textit{$G(V,E)$} be a graph and \textit{$V$} be the set of vertices and \textit{$E$} be the set of edges. If \textit{${u,v} \in E$} then \textit{u} and \textit{v} are said to be adjacent. The set of vertices adjacent to a vertex \textit{$v$} is called the neighbourhood of v and is denoted by \textit{$N(v)$}.  A clique of a graph \textit{G} is a set of vertices \textit{$C$} in which \textit{${u, v} \in C \implies {u, v} \in E$}. We say that graph contains a \textit{k}-clique, if there is a subset of \textit{k} vertices that are connected to each other. A maximum clique is a complete sub graph of a graph \textit{G}  whose size is largest among all other complete sub graphs in \textit{G}. A maximal clique \textit{C} of a graph \textit{G} is a clique for which it is not possible to add an additional vertex to \textit{C} and \textit{C} remains a clique. In the graph of Fig 3 there are six vertices, but available cliques are $(2 3 4) (3 5 2) (5 4 3) (4 2 5) (2 3 4 5)$ and maximum clique is $(2 3 4 5)$.
\paragraph{\textbf{Quantum Oracle and query:-}}
\par Virtually quantum algorithms work with queries. In an N-bit input $x = (x_1, . . . , x_N)$ where $N = 2^n$, the address bit $x_i$ (i=1,2...N) can be accessed using an n-bit index i. As a quantum operation, this would be the following unitary mapping on $n + 1$ qubits. \par
$O_x \colon \ket{i, 0} \implies \ket{i,x_i}$\par
The first n qubits of the state are called the address bits, the $(n + 1)$ st qubit is called the target bit. This is an unitary operation as shown below.\par
 $O_x \colon \ket{i,b} \implies \ket{i, b \oplus x_i}$
\par here $i \in {0,1}^n, b \in {0, 1}$, and $\oplus$ denotes exclusive-or (addition modulo 2). $O_x$ is a permutation matrix and hence unitary. This $O_x$ is called an oracle which is a black box. A quantum computer can apply $O_x$ on a superposition of various i. One application of this black-box is called a query.

\justify
\subsection{Quantum Logic Gates Used in the Oracle for \textit{k}-Clique Problem}
Quantum Circuit is a model for quantum computation where reversible quantum gates like Hadamard, CNOT, Toffoli are used. The Matrix representation of the quantum gates is shown in the following table 1.
\begin{table}[htb]
\centering
\tcaption{Matrix Representation of Quantum Gates}
\scriptsize

\begin{tabular}{ | c | c | }
 \hline
 Quantum Gates & Matrix Representation \\
 \hline
 Hadamard Gate & $\begin{pmatrix}
\\ \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}
\\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{pmatrix}$ \\
 \hline
 NOT GATE  &  $\begin{pmatrix}
\\ 0 & 1
\\ 1 & 0
\end{pmatrix}$\\
 \hline
 TOFFFOLI Gate &  $\begin{pmatrix}
\\ 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0
\\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0
\\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0
\\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0
\\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0
\\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0
\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1
\\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0
\end{pmatrix}$ \\
 \hline
 R$(\theta)$ Gate & $\begin{pmatrix}
 \\ 1 & 0
 \\ 0 & e^{i\theta}
 \end{pmatrix}$ \\
 \hline

\end{tabular}
\end{table}

Apart from theses three gates, Multi-Controlled Toffoli Gate(MCT) is also required. There are n number of inputs and outputs in an $n$-bit MCT. This MCT gate passes the first $n-1$ inputs, which are referred as control bits to the output unaltered. It inverts the $n^{th}$ input, which is referred as the target bit if the first $n-1$ inputs are all one. An MCT gate is shown in Fig 4 Black dots $\bullet$ represent the control bits and the target bit is denoted by a $\oplus$.
\begin{figure}[h]
\centering
\includegraphics[width= 3in]{mtof_f.png}
\fcaption{Multi-Control Toffoli Gate}
\end{figure}

\justify
\subsection{IBMQ Quantum Processor}
In recent years, NISQ (Noisy Intermediate Scale Quantum devices) that can perform quantum computation with a short circuit length have appeared, although the scale and accuracy are insufficient to perform continuous, effective error correction. Various physical systems such as superconductors, ion traps, quantum dots, NV centres, and optics are used in NISQ devices.
The IBM Q processors accept gates written in the QASM language
All circuits are decomposed into four types of gate.
We describe those gates and the required pulses in the IBM Q superconducting processors in Table 2
\begin{table}[htb]
\centering
\tcaption{Gate Set for QASM}
\begin{tabular}{c|c}
gate type &  remarks \\ \hline
$U1(\lambda)$      & No pulse.     Rotation $Z$~($R_Z$) gate.   \\
$U2(\phi,\lambda)$    & One $\frac{\pi}{2}$ pulse.     $H$ gate is $U2(0,\pi)$. \\
$U3(\theta, \phi, \lambda)$     & Two  $\frac{\pi}{2}$ pulses.   $R_Y(\theta)$ gate is $U3(\theta, 0, 0)$. \\
$CX$ &  Cross-resonance pulses and One $\frac{\pi}{2}$ pulse.
\end{tabular}
\label{tab:gates}
\end{table}
Since no pulse is required, we can perform \textsc{$U1$}\xspace~with zero cost.
The error level of \textsc{$U3$}\xspace~is twice \textsc{$U2$}\xspace~and approximately an order of magnitude less than the $CX$ gate.

\justify
\subsection{General hybrid architecture for quantum algorithms}
In this paper, the concept of hybrid quantum and classical computing is used\cite{17}. In a Hybrid quantum classical architecture, classical algorithm is used for performing some basic operations(preparation of inputs, feeding output to the quantum machine) which may be required by the quantum algorithm. Quantum subsystem of this architecture initializes the quantum registers/nodes, prepare the inputs by applying quantum gates, execute the quantum oracle with the help of quantum gates and unitary transformations, and finally evaluate the result stored in the quantum registers. General architecture of the hybrid model is shown in fig 5.
\begin{figure}[h]
\centering
\includegraphics[width=3in]{hybridmodel.png}

\fcaption{The relationship between classical part and quantum part of the hybrid algorithm}\cite{17}
\end{figure}

\justify
\section{Synthesis of \textit{k}-Clique Problem}
This section outlines the proposed methodology for the circuit synthesis of the \textit{k}-clique problem using Grover's search algorithm. \textit{k}-clique problem takes an adjacency matrix of a graph as input and determines whether a clique of size \textit{k} exists within the graph. As mentioned in the previous section, there are two parts to the Grover's search algorithm. While the diffusion operator is predefined for all problem instances, the Oracle is specific to the given search problem. Hence, this paper proposes the design of an Oracle circuit that takes a graph as input and determines if the graph contains a clique of size \textit{k}. The Oracle then marks those states that form a clique before the diffusion operator is applied to them.
\subsection{General Flow of Proposed Work for \textit{k}-clique Problem}
The complete flow of proposed design for mapping \textit{k}-clique problem from a graph to quantum computer is shown in Fig 6. The proposed algorithm takes adjacency matrix as input and gives a QASM gate list as output. This QASM gate list can further be used as an input to a NISQ device for verification.
\begin{figure}[h]
\centering
\includegraphics[width= 2in]{newflow.png}

\fcaption{The complete flow of Our Proposed Work}
\end{figure}
\subsection{Proposed Model For \textit{k}-Clique Problem}
The Fig 7 shows the generalized view of the oracular circuit for k-clique problem. The aim of this paper is to construct the quantum circuit block for \textit{k}-clique problem. Theoretically, the Oracle is only a function that checks whether a specific item is the target. However, due to the linearity of quantum mechanics, when the Oracle is applied to the superposition state $\ket{\psi_{0}}$, all possible items are examined against the criteria. It follows from the fact that the eigenvalue of $(1/\sqrt{2})(\ket{0}-\ket{1})$, i.e., $-1$, is kicked back to the target state with the help of CNOT operation. In this generalized circuit there are four blocks; Qubit activation block and Qubit deactivation block, Edge detection block, Clique detection block and Phase flip block. The functionality of the blocks has been described below for finding \textit{k}-clique in a graph.

 \begin{flushleft}

    \begin{figure*}[h]

\hspace{-2cm}
\includegraphics[width=17cm,height=6cm]{gendiagramnew.png}
\fcaption{Circuit Representation of Oracle for \textit{k}-clique Problem}
\label{fig6a}
\end{figure*}
\end{flushleft}

\subsubsection{Initialization}
If there are $n$ vertices in the input graph, then the number of qubits required to represent each vertex is $\ceil{\log_2 n}$. The Oracle checks a combination of \textit{k} vertices from a combination of all \textit{k} vertices without duplicate vertices set at a time to determine if a clique is formed by them. Hence, a total of $m=k*\ceil{\log_2 n}$ input qubit lines are required to represent a combination of \textit{k} vertices for input. Total number of ancilla qubits required to verify whether the subgraph formed by \textit{k} number of vertices is complete or not is $k \choose 2$. The initial input qubits in Fig 7 include $m$ qubits prepared in the ground state $\vert\psi\rangle=\ket{0}^{\otimes m}$, ({$k \choose 2$} +1) ancilla qubits in the ground state $\ket{\theta}=\ket{0}^{\otimes {k \choose 2} +1}$ (These ($k \choose 2$ +1)ancilla qubits are required to prepare clique detector block, which is described in the next subsection thoroughly) and one output qubit in the excited state $\ket{\phi}=\ket{1}$ is required to perform the CNOT operation of the Oracle. This entire initialization can be mathematically  written as:

\[\vert\psi\rangle\otimes\vert\theta\rangle\otimes\vert\phi\rangle=\vert 0\rangle^{\otimes m}\otimes\vert 0\rangle^{\otimes {k \choose 2} +1}\otimes\vert 1\rangle\]
\subsubsection{Hadamard Transformation}

After the initialization, the Hadamard transform $H^{\otimes m}$ on input qubits and $H$ on output qubit is performed, therefore all possible states are superposed as $\ket{\psi_{0}}\otimes\ket{\theta_{0}}\otimes\ket{\phi_{0}}$, where

\[\vert\psi_{0}\rangle=\,{1\over\sqrt{2^{m}}}\sum_{i=0}^{2^{m}-1}\vert i\rangle\]

\[\ket{\theta_{0}}=\ket{0000...0}\]

\[\vert\phi_{0}\rangle=\,{1\over\sqrt{2}}\left(\vert 0\rangle-\vert 1\rangle\right)\]

 \subsubsection{Reduction in search space}

 For a given graph, vertices need to be numbered as $\{0,1,2 .... n-1\}$. The input qubit lines act as the binary representation of combination of \textit{k} vertices. After Hadamard transformation on input qubit lines, $\ket{\psi_{0}}$ represents all possible combination of \textit{k} vertices of given graph. But, the oracle checks only the combination of \textit{k} vertices without any duplicate entry of vertices to determine if a clique exist or not. After Hadamard transformation we get superposition of all states which includes several invalid states. So we have reduced the search space by excluding all invalid vertex combinations that does not contribute to clique. Only valid vertex combinations that may form a clique is considered using a technique named as Qubit Activation. To make sure that the Oracle is checking only the all possible combinations of \textit{k} vertices without duplicate entry, all the input qubit lines need to be in the excited state $\ket{1}$ for those particular combination of \textit{k} vertices to make input qubit lines suitable as control lines for Multi Control Toffoli(MCT) operation.
 \par\textbf{Qubit Activation} A number of NOT gate has to be imposed on the input qubit lines, which are in the ground state $\ket{0}$ for every possible combination of three vertices without duplicate entry.
 The qubit activation block activates a qubit by applying NOT gate if it is 0, such that the desired inputs are string of 1's. \par

 \subsubsection{Clique Detector Block}

The proposed Clique Detector Block is shown in Fig 8. This block is defined as follows:\\
\[
  CliqueDetector(a,b,c...k,f) =
  \begin{cases}
                                   \text{$f=1$} & \text{if $a$, $b$, $c$ ....$k$ form a clique} \\
                                   \text{$f=0$} & \text{otherwise} \\
  \end{cases}
\]
where $a$, $b$, $c$...$k$ are the combination of \textit{k} vertices of the input graph, which are activated input qubit lines and the $f$ is the circuit output of Clique Detector Block, which is represented by $({k \choose 2} +1)^{st}$ ancilla qubit line. Then, the Edge Detector Block imposes if a pair of vertices of input graph is adjacent. This edge detecting sub-circuit is defined as follows:
\subsubsection{Edge detection block} The function of the edge detection block is to detect edges between pair of vertices. A Toffoli gate is applied for checking the connectivity between a pair of vertices. One Toffoli gate indicates presence of edge between a pair of vertices. So for detecting multiple edges, multiple Toffoli gates are needed.

\[
  EdgeDetector(a,b,f) =
  \begin{cases}
                                   \text{$f=1$} & \text{if $a$ and $b$ are adjacent} \\
                                   \text{$f=0$} & \text{otherwise} \\
  \end{cases}
\]
This sub-circuit Edge Detector Block checks if two vertices are adjacent and changes the state of the output line to $\ket{1}$. First $k \choose 2$ ancilla lines are the representation of these output lines. If this is true to all $k \choose 2$ ancilla lines, the Clique Detector confirms the presence of a clique in the form of $\ket{1}$ state on the $({k \choose 2 }+1)^{st}$ ancilla line, otherwise the state of $({k \choose 2} +1)^{st}$ ancilla line remain same as it's initial state $\ket{0}$. Therefore, if there exists a clique, the ancila qubit state becomes $\ket{\theta_{1}}$ for respective input vertices. \[\ket{\theta_{1}}=\ket{1111...1}\]
Clique detection block detects a clique by applying Toffoli gate between the output of edge detection blocks.
\begin{figure}[h]
\centering
\includegraphics[width=7cm, scale=1]{k-cliquedetectorblock.png}
\fcaption{Circuit Representation of k-Clique Detector Block}
\label{fig6}
\end{figure}
\subsubsection{Qubit Deactivation} A number of NOT gate has to be imposed on the input qubit lines in the reverse order to deactivate the qubits again or to reset the input qubits to their initial value. \par
\subsubsection{CNOT Operation}
The output qubit state $\vert\phi_{0}\rangle$ is initially set as
${1\over\sqrt{2}}\left(\vert 0\rangle-\vert 1\rangle\right)$. Applying an CNOT gate on output line considering $(k \choose 2 +1)^{st}$ ancilla qubit as control results in an eigenvalue kickback $-1$,
which causes a phase shift for the respective input state, which makes a clique.

\justify
\subsection{Implemented Classical-Quantum Hybrid Architecture in \textit{k}-Clique Problem}
The complete flow of proposed design for mapping \textit{k}-clique problem from a graph to quantum computer is shown in Fig 9. The proposed algorithm takes adjacency matrix as input and gives QASM gate list as output. This QASM gate list can further be used as an input to quantum simulator for verification or to map into quantum technologies. To estimate quantum gate cost for \textit{k}-clique problem, QASM gate list is also used.
The complete cycle of the hybrid architecture for the synthesis of \textit{k}-Clique Problem has been pictorially described below:
 \begin{figure}[!htb]
\centering
\includegraphics[width=5in]{hybridnew.png}
\fcaption{The flow of the algorithm with classical and quantum parts }
\end{figure}
 \par The algorithm for the synthesis of \textit{k}-Clique Problem is a hybrid algorithm that consist of classical and quantum components. The quantum portion of the algorithm is probabilistic; often need multiple runs to get the desired result.
\begin{itemize}
\item \textbf{Classical input}:
\begin{itemize}
\item \textbf{Adj[][]}:Adjacency matrix of the input graph G(V,E).
\item \textbf{arr[]}: Array that holds the vertices of the graph.
\item \textbf{$comb_{arr}[]$}: Array that holds all combinations of the vertices for a clique size.
\item \textbf{active[]}: Array that holds the binary equivalent of all combinations of vertices.
\end{itemize}
\item \textbf{Classical part of the algorithm}:
\begin{itemize}
\item Classical part of the algorithm prepares all possible input combination of the vertices for a clique size. It creates $n \choose k$ combination of vertices if n is the total number of vertices and k is clique size.
\end{itemize}
\item \textbf{Quantum input}:
\begin{itemize}
\item I[]: This is a quantum register that holds the input qubits.
\item A[]: This is a quantum register that holds the ancilla qubits.
\item T[]: This is a quantum register that holds the target qubits.
\item O[]: This is a quantum register that holds the output  qubit.
\end{itemize}
\item \textbf{Quantum part of the algorithm}
\begin{itemize}
\item Quantum portion of the algorithm are executed in quantum computers, where quantum gates(Hadamard,Toffoli,NOT,CNOT) and unitary transformations are applied on the input qubits.
 \end{itemize}
  \end{itemize}

The execution of the algorithm in a hybrid architecture is as follows:
\begin{itemize}
\item \textbf{Step 1}: Initialize Adjacency Matrix for the input graph. Calculate the total number of combinations of vertices using a classical algorithm.
\item \textbf{Step 2}: Initialize quantum register I[] that holds the input qubits.
\item \textbf{Step 3}: Apply Hadamard gates on the input qubits that represent vertices of the graph.
\item \textbf{Step 4}: Apply Hadamard gate on the output qubit.
\item \textbf{Step 5}: Prepare input state by making it a string of '1's by applying quantum NOT gate.
\item \textbf{Step 6}: Execute the quantum oracle for finding the marked states. The oracle checks full connectivity in a set of vertices by applying quantum gates and unitary transformations.
\item \textbf{Step 7}: Apply Grover's operator for maximizing the amplitude of the marked states.
\item \textbf{Step 8}: Measure the output of quantum registers using classical register.

 \end{itemize}
 \justify
 \subsection{Automated and Generalized Algorithm of quantum circuit synthesis for \textit{k}-Clique Problem}
 The proposed algorithm of oracular circuit synthesis for the \textit{k}-clique problem is illustrated in this subsection. Algorithm 1 describes the algorithm for Oracle circuit synthesis of the \textit{k}-clique problem. The algorithm takes as input the adjacency matrix of the given graph and the clique size to be searched. The output of the algorithm is the Oracle circuit in the form of a circuit netlist.
 \begin{algorithm}[]

  \caption{AutoGenerateOraclek-Clique}
  \scriptsize
\KwIn{Adjacency matrix $adj(n,n)$ of graph $G(V,E)$. Size of the clique to be searched that is \textit{k}. $I_m$ are input qubit lines where $1 \leq m \leq k*\ceil{\log_2 n}$. $A_x$ and $T$ are ancilla lines where $1 \leq x \leq {k \choose 2}$. $O$ is output line.
}

\KwOut{Circuit Netlist(QASM)}
Initialize $I_m$ input lines with $\ket{0}$ followed by Hadamard gate, $A_x$ ancilla lines with $\ket{0}$, $T$ ancilla line with $\ket{0}$, and output line $O$ with $\ket{1}$ followed by a Hadamard gate.
Make $n \choose k$ combinations of vertices and store them in an array $comb_{arr}$. Initialize $comb\leftarrow 0$, $m\leftarrow k*\ceil{\log_2 n}$ and $x\leftarrow 1$\;

\textbf{Repeat $n \choose k$ times}\\
\If{($adj(comb_{arr}(comb),comb_{arr}(comb+1))\leftarrow 1$ \&\& $adj(comb_{arr}(comb),comb_{arr}(comb+2))\leftarrow 1$ \&\& ...$adj(comb_{arr}(comb+1),comb_{arr}(comb+k))\leftarrow 1$)}
{
insert Qubit Activation Block;\\
insert \textit{k}-clique Detector Block;\\
insert Qubit Deactivation Block;
}
$comb \leftarrow comb+k, x \leftarrow 1$\;
Insert CNOT gate $T$ line as control and $O$ output line as target\;

 For mirror circuit:\\
\textbf{Repeat $n \choose k$ times}\\
\If {($adj(comb_{arr}(comb),comb_{arr}(comb+1))\leftarrow 1$ \&\& $adj(comb_{arr}(comb),comb_{arr}(comb+2))\leftarrow 1$ \&\&... $adj(comb_{arr}(comb+1),comb_{arr}(comb+k))\leftarrow 1$)}
{
insert Qubit Activation Block;\\
insert \textit{k}-clique Detector Block;\\
insert Qubit Deactivation Block;
}
$comb \leftarrow comb+k, x \leftarrow 1$\;
    \end{algorithm}

\begin{algorithm}[]
\caption{Qubit Activation Block \& Qubit Deactivation Block}
\scriptsize
\label{alg:oneone}

Binary representation of {$comb_{arr}[comb]$, $comb_{arr}[comb+1]$... $comb_{arr}[comb+k]$} in $\ceil{\log_2 n}$ binary digits stores in an array $active$\;
Qubit Activation Block:\\
\For{$r\leftarrow 0$ to $m-1$}
{
\If{$active(r)\leftarrow 0$}
{
insert NOT gate to qubit line $I_{r+1}$ to make input qubit line active. $r\leftarrow r+1$;
}
\Else{$r\leftarrow r+1$}

}

Qubit Deactivation Block:\\
    \For{$r\leftarrow 0$ to $m-1$}
{
\If{$active(r)\leftarrow 0$}
{
insert NOT gate to qubit line $I_{r+1}$ to make input qubit line active. $r\leftarrow r+1$;
}
\Else{$r\leftarrow r+1$}

}

    \end{algorithm}

\begin{algorithm}[]
\caption{\textit{k}-clique Detector Block}
\scriptsize
\label{alg:onetwo}

    \For{$i\leftarrow comb$ to $comb+k-2$}
    {
        \For{$j\leftarrow i+1$ to $comb+k-1$}
        {

            \If{$adj(comb_{arr}(i),comb_{arr}(j))\leftarrow 1$}
            {
            \If{$(j+1)\%k\leftarrow 0$}
            {
                insert a multi-controlled Toffoli gate with $I_{((i\%k)*\ceil{\log_2 n})+1}$ to $I_{((i+1)\%k)*\ceil{\log_2 n}}$ input qubit lines and $I_{((j\%k)*\ceil{\log_2 n})+1}$ to $I_{((j\%k)+1)*\ceil{\log_2 n}}$ input qubit lines as control and ancilla $A_x$ as target. $x\leftarrow x+1$\;
            }
            \Else
            {
             insert a multi-controlled Toffoli gate with $I_{((i\%k)*\ceil{\log_2 n})+1}$ to $I_{((i+1)\%k)*\ceil{\log_2 n}}$ input qubit lines and $I_{((j\%k)*\ceil{\log_2 n})+1}$ to $I_{((j+1)\%k)*\ceil{\log_2 n}}$ input qubit lines as control and ancilla $A_x$ as target. $x\leftarrow x+1$\;
            }

            }
            \Else
            {
        $x\leftarrow x+1$\
            }
        }
    }
    Insert a k-controlled Toffoli gate with each of the k $A_x$ ancilla lines as control and ancilla $T$ as target\;
    $x\leftarrow k$\, $comb\leftarrow 0$\;
 \For{$j\leftarrow comb+k-1$ to $comb+k-2$}
    {
        \For{$i\leftarrow j-1$ to $comb$}
        {
            \If{$adj(comb_{arr}(i),comb_{arr}(j))\leftarrow 1$}
            {
            \If{$(j+1)\%k\leftarrow 0$}
            {
                insert a multi-controlled Toffoli gate with $I_{((i\%k)*\ceil{\log_2 n})+1}$ to $I_{((i+1)\%k)*\ceil{\log_2 n}}$ input qubit lines and $I_{((j\%k)*\ceil{\log_2 n})+1}$ to $I_{((j\%k)+1)*\ceil{\log_2 n}}$ input qubit lines as control and ancilla $A_x$ as target. $x\leftarrow x-1$\;
            }
            \Else
            {
             insert a multi-controlled Toffoli gate with $I_{((i\%k)*\ceil{\log_2 n})+1}$ to $I_{((i+1)\%k)*\ceil{\log_2 n}}$ input qubit lines and $I_{((j\%k)*\ceil{\log_2 n})+1}$ to $I_{((j+1)\%k)*\ceil{\log_2 n}}$ input qubit lines as control and ancilla $A_k$ as target. $x\leftarrow x-1$\;
            }
            }
            \Else{$x\leftarrow x-1$}
        }
    }

\end{algorithm}
 The steps of the algorithms are described as follows:
 \begin{enumerate}[Step 1:]

\item  From the adjacency matrix, the number of vertices in the graph are obtained, which is used to calculate the total number of qubit lines required for the Oracle circuit. If there are $n$ vertices in the input graph, at first vertices are indexed as $\{0, 1, 2, ... n-1\}$. The algorithm stores $n \choose k$ combination of vertices without duplicate entry in an array called $comb_{arr}$. The number of qubits required to represent each vertex is $\ceil{\log_2 n}$. Hence, a total of $k*\ceil{\log_2 n}$ qubit lines are required for input. There are two types of ancilla qubit lines, $A_x$ and $T$ which are initialized by $\ket{0}$. $A_x$ ancillas are used for checking whether two vertices are connected by an edge and $T$ ancilla is used for checking if $k \choose 2$ edges form a clique of size \textit{k}. There is one output line $O$, initialized to $\ket{1}$, which indicates if a clique of size \textit{k} exists in the input graph.\\
\item The algorithm first applies Hadamard gates on all input qubit lines. For every possible combination from array $comb_{arr}$, binary representation of \textit{k} vertices in $\ceil{\log_2 n}$ binary digits stores in array $active$ is required to activate all input qubit lines having $\ket{0}$ quantum state using appropriate NOT gates to make them suitable as control lines for MCT operation with the help of qubit activation method. This qubit activation method is described in Algorithm \ref{alg:oneone}.\\

\item For every possible combination from array $comb_{arr}$, the algorithm checks for every possible vertex pairs $(comb_{arr}(i),comb_{arr}(j))$ are connected by an edge, if this is true then insert
a \textit{k}-clique detector block on appropriate qubit lines for respective vertices. If this is false, then algorithm will check for next possible combination of vertices.\\

The circuit synthesis of \textit{k}-clique Detector Block is described in Algorithm \ref{alg:onetwo}. The algorithm checks for every possible combination of \textit{k} vertices without duplicate entry, for every possible vertex pairs $(comb_{arr}(i),comb_{arr}(j))$ are connected by an edge, if this is true then multi-controlled Toffoli gate with $I_{((i\%k)*\ceil{\log_2 n})+1}$ to $I_{(i\%k)*\ceil{\log_2 n}}$ input qubit lines and $I_{((j\%k)*\ceil{\log_2 n})+1}$ to $I_{((j\%k)+1)*\ceil{\log_2 n}}$ input qubit lines as control and one of the ancilla $A_x$ as target if $j\%k$ is zero, where $i, j$ are the index values of array $comb_{arr}$ or else insert a multi-controlled Toffoli gate with $I_{((i\%k)*\ceil{\log_2 n})+1}$ to $I_{(i\%k)*\ceil{\log_2 n}}$ input qubit lines and $I_{((j\%k)*\ceil{\log_2 n})+1}$ to $I_{(j+1)*\ceil{\log_2 n}}$ input qubit lines as control and one of the ancilla $A_x$ as target. If all vertex pairs of a vertex combination are adjacent then each of the  $A_x$ ancilla qubits are activated which implies there exists a clique of size k between them. This information is stored in the $T$ ancilla by applying a $k \choose 2$-controlled Toffoli gate with $A_{k \choose 2}$ ancillas as control and $T$ ancilla as target. These steps are need to be repeated followed by Qubit Deactivation Block to generate the mirror of it in order to keep the overall circuit reversible. \\

\item The algorithm then applies a CNOT gate to the output line with $T$ ancilla as control. As a result, the output line shall indicate the presence of a clique of size k in the graph. If on the other hand, there is no clique of size k in the input graph, $T$ ancilla will be in their initial state $\ket{0}$ which results in the output line being in the initial state indicating the absence of a clique of size k in the graph.

\par The remaining steps of the algorithm generates the mirror for the original circuit in order to keep the overall circuit netlist reversible. To understand Algorithm 1 more precisely, an example of 4 vertices graph has been considered and how the Oracle circuit generated for the example graph by the proposed algorithm is illustrated in next section.

\end{enumerate}
\subsection{Diffusion}
The second part of Grover's algorithm is the circuit implementing the function of diffusion. When the operation is applied to a superposition state, it actually keeps the component in the $\ket{\psi_{0}}$ direction unchanged, while inverting the components in dimensions that are perpendicular to $\ket{\psi_{0}}$. This can be represented as

\[I_{\left\vert\psi_{0}^{\perp}\right\rangle}=-I_{\vert\psi_{0}\rangle}\]

where \[\vert\psi_{0}\rangle=\,{1\over\sqrt{2^{n}}}\sum_{i=0}^{2^{n}-1}\vert i\rangle\]

The diffusion operator is a unitary matrix. The general matrix for the diffusion operator for an $N$-dimensional quantum system is shown in Fig. \ref{fig7}.

\begin{figure}[!htb]
\centering
\begin{align*}
diff_n=
\begin{bmatrix}
    \dfrac{2}{N} - 1 & \dfrac{2}{N} & . . . & \dfrac{2}{N} \\\\
    \dfrac{2}{N} & \dfrac{2}{N} - 1 & . . . & \dfrac{2}{N}\\
    . & . & . & .\\
    . & . & . & .\\
    . & . & . & .\\
    \dfrac{2}{N} & \dfrac{2}{N} & . . . & \dfrac{2}{N} -1
\end{bmatrix}
\end{align*}
\fcaption{Matrix Representation of N-dimensional Diffusion Operator }
\label{fig7}
\end{figure}
\subsection{Automated and Generalized Algorithm of quantum circuit synthesis for Maximum Clique Problem using the approach of \textit{k}-clique algorithm}
The automated and generalized algorithm of quantum circuit synthesis for Maximum Clique Problem is discussed in this section. Maximum Clique Problem finds clique in a graph with maximum cardinality. Input of the algorithm is the Adjacency Matrix of the graph $G(V,E)$ and the output is the QASM gatelist. The algorithm uses the concept of \textit{k}-clique algorithm proposed above. The algorithm starts with finding clique of size k=n using the algorithm of \textit{k}-clique. If a clique is found, it is maximum clique of the graph. Otherwise a clique is searched of size $n-1$. The process continues up to n=2. The steps of synthesis of Maximum Clique problem is shown below.\par

  \par\textbf{Steps of synthesis of the Maximum Clique Problem}\par
  \begin{itemize}
  \item \textbf{Step 1}: The algorithm starts from the nth vertex where (n=total number of vertex). At first, presence of a clique of size $n$ is checked.\par
  \item \textbf{Step 2}: Algorithm for finding \textit{k}-clique is used for searching clique of size n

  \item \textbf{Step 3}: If a clique is found, then exit from the process.
  \item \textbf{Step 4}: If clique is not found, then clique size n is reduced to n-1 and repeat the whole process from step 2.
  \item \textbf{Step 4}: At each iteration the value of n is reduced by 1 (n, n-1,n-2,n-3,...2) until a clique is found.

\end{itemize}

  \begin{algorithm}[]

  \caption{AutoGenerateOracleMaximumClique}
  \scriptsize
  \KwIn{Adjacency Matrix Adj[][]}
  	\KwOut{A file "OutputMaximumClique.QASM"}
  	 keep all vertices of the input graph($n$) in an array $arr[]$ \\
  	  	\For {$i \leftarrow n$ downto $2$}
  	  		{
  	  		\textbf{Use \textit{k}-clique alogorithm for finding clique of size $i$} \\
  	  		 \If {clique of size $i$ is found}
  	  		 {
			 		\textbf{Maximum clique is found of size $i$ } \\
			         \textbf{Exit from the loop} \\
			}
  	  		}

\end{algorithm}
\

The Oracle circuit generated by Algorithm \textbf{AUTOGENORACLEMAXIMUMCLIQUE} is reversible. Different unique combinations of NOT gates corresponding to the input values are used on the input qubits to make them $\ket{1111 ... 1}$. Then Toffoli gates are used where input qubits act as control qubits and one of the ancillary qubit acts as the target qubit. The algorithm then uses the combination of NOT gates used at input qubits again to get the input vertex back. Hence, the generated circuit is reversible.
\justify
\section{Circuit for finding \textit{k}-clique and maximum clique in some exemplified graphs}
\par In this section quantum circuit for finding \textit{k}-clique of two arbitrary graph $G(V,E)$ has been designed following the above method. Let us consider an arbitrary graph $G(V,E)$ of figure 11. The graph has four vertices, so two qubits are needed to represent each vertex.
\subsection{Circuit for finding 3-clique in a Graph}
The circuit for finding triangle in the graph of Fig 12 has been shown in Fig 13. For a $4$-vertex graph, adjacency matrix is represented by $adj(4, 4)$ and vertices are indexed as ${0, 1, 2, 3}$. Each vertex is represented by $\ceil{\log_2 4}=2$ qubits. Hence, total six qubit lines are required for inputs. As per algorithm 1, input qubit lines are represented as $I_{m}$ , where $1\leq m \leq 6$. These input qubit lines are initialized with $0$ followed by Hadamard gate. Input lines are numbered from bottom to top. In order to store edge information, three ancilla lines $A_{x}$, where $1\leq x \leq 3$ and one ancilla line $T$ initialized to $\ket{0}$ are required and one output line $O$ initialized to $\ket{1}$ followed by Hadamard gate is required to store the output of the circuit. Hence, a total of $11$ qubit lines are required for the simulation. The algorithm now stores $4 \choose 3$ $=$ $4$ possible combination of vertices as $((0, 1, 2), (0, 1, 3), (0, 2, 3), (1, 2, 3))$ in an array called $comb_{arr}$. The algorithm now initializes variable $comb$ as $0$, variable $m$ as $6$ and $x$ as $1$.\\
\begin{itemize}
\item At first the algorithm considers the first combination of three vertices. Hence, binary representation of three vertices $(0, 1, 2)$ in $\ceil{\log_2 4}=2$ binary digits  as $(000110)$ stores in an array $active$
\item For each zero in $active$ array, insert NOT gate to qubit line $I_{r+1}$ where $r$ is the index value of $active$ array to make these input lines suitable as control for MCT operation or edge detector block.
\item Thereafter, for every possible vertex pair $(0,1)$, $(0,2)$, and $(1,2)$, the algorithm checks that they are connected by an edge by accessing the information of adjacency matrix.
\item At first for vertex pair ($(comb_{arr}(i=0), comb_{arr}(j=2))=(0,2)$, $adj(0,2)=1$, then  $(j+1)\%3$ is zero, then insert an MCT gate with $I_{1}$ to $I_{2}$ input qubit lines and $I_{5}$ to $I_{6}$ input qubit lines as control and $A_{1}$ as target.
\item In case of vertex pair $(comb_{arr}(i=0), comb_{arr}(j=1))=(0,1)$, $adj(0,1)=1$, insert an MCT gate with $I_{1}$ to $I_{2}$ input qubit lines and $I_{3}$ to $I_{4}$ input qubit lines as control and $A_{2}$ as target.
\item Similarly, for vertex pair $(comb_{arr}(i=1), comb_{arr}(j=2))=(1,2)$, the entry for the adjacency matrix $adj(1,2)$ is 0 as there are no edge between vertex 1 and 2. So we do not insert any MCT gate on the $A_{3}$ ancilla line.
\item Thereafter, Insert a three-controlled Toffoli gate with each of the three $A_{1}$, $A_{2}$, and $A_{3}$ ancilla lines as control and $T$ ancilla as target.
\item Again to make three $A_{1}$, $A_{2}$, and $A_{3}$ ancilla lines reusable, In case of vertex pair $(comb_{arr}(i=0), comb_{arr}(j=1))=(0,1)$, $adj(0,1)=1$, insert an MCT gate with $I_{1}$ to $I_{2}$ input qubit lines and $I_{3}$ to $I_{4}$ input qubit lines as control and $A_{2}$ as target.
\item for vertex pair ($(comb_{arr}(i=0), comb_{arr}(j=2))=(0,2)$, $adj(0,2)=1$, then  $(j+1)\%3$ is zero, then insert an MCT gate with $I_{1}$ to $I_{2}$ input qubit lines and $I_{5}$ to $I_{6}$ input qubit lines as control and $A_{1}$ as target.

\item These steps are repeated for other three combination of three vertices. The algorithm then applies a CNOT gate to the output line $O$ with $T$ ancilla as control. As a result, the output line shall indicate the presence of a clique in the graph. The remaining steps of the algorithm generate the mirror for the original circuit in order to keep the overall circuit netlist reversible.
\end{itemize}
 \begin{figure}[h]
\centering
\includegraphics[width= 1.5in]{squarediag.png}
\fcaption{Graph with clique size 3}

\end{figure}

\begin{figure}[h]
\hspace{-2cm}
\includegraphics[width= 6in]{4c3final.png}
\fcaption{circuit for checking the presence clique of size 3}

\end{figure}
\subsection{Circuit for finding maximum clique of size 3 in a graph }
 Let us consider the graph of Fig 11. As we can see it has two cliques of size 3.
 According to the algorithm existence of cliques is checked for four, three and two vertices. Whenever a clique is found the process is stopped. Each circuit goes through the following number of stages:

 \begin{itemize}
  \item Step1: Initially Hadamard gate is applied parallely on the input qubits and output qubit for getting the superposition of the states.
  \item Step2: Search space is reduced using NOT gate. NOT gate is applied on the selected input qubits for making all input states a string of 1s or activating the qubits
  \item Step3: Multi Controlled Toffoli gates are applied between the input vertices for edge detection between the input vertices.
  \item Step4: Multi Controlled Toffoli gates are used to detect clique between a set of vertices
  \item Step5: Same set of NOT gates are applied to the input qubits for the deactivation of the input qubits.

  \item Step6: Step 2 to step 5 are repeated for every combination of vertices.
  \item Step7: A CNOT gate is applied for the final output of the circuit.
  \item Step8: For every combination of vertices same Toffoli gates are inserted in a reverse way starting from the last one.
  \item Step9: Grover's diffusion operator is applied for the amplification of marked states.

  \end{itemize}

\subsubsection{Circuit for finding clique of size 4}
The circuit for finding clique of size 4 is given in the figure 13. Input qubits are numbered from the bottom to the top. The total number of vertices of the graph is 4. As we are going to find clique of size 4, total number of qubit required is $4*log_2(4)$=8. The total number of combination is $4 \choose 4$ that is one. The combination is ($\ket{00}$,$\ket{01}$,$\ket{10}$,$\ket{11}$). Hadamard gates are applied parallely to the input qubits. Search space is reduced using qubit activation technique. Qubits are activated by applying NOT gates to the 0 qubits. There is no interconnection between $\ket{01}$ and $\ket{10}$ vertex. There are five edges in the graph. So there are five Toffoli gates. Circuit for checking the presence of clique size 4 is shown below in Fig 13. As there is no clique of size 4, output is 0. So we keep on checking for a clique of size 3 which is described below.
\begin{figure}[h]
\centering
\includegraphics[width= 4in]{4c4cliq.png}
\fcaption{circuit for checking the presence of clique size 4}
\end{figure}
\subsubsection{Circuit for finding clique of size 3}
The circuit for finding clique of size 3 is given in the figure 12. Input qubits are numbered from the bottom to the top. The total number of vertices is 4. As we are going to find clique of size 3, total number of qubit required is $3*log_2(4)$=6. The total number of combination is $4 \choose 3$ that is four. The combinations are ($\ket{00}$,$\ket{01}$,$\ket{10}$,),($\ket{00}$,$\ket{01}$,$\ket{11}$),($\ket{01}$,$\ket{10}$,$\ket{11}$), ($\ket{00}$,$\ket{10}$,$\ket{11}$). Hadamard gates are applied parallely to the input qubits and output qubit. Search space is reduced using Qubit Activation by using NOT gates to the 0 qubits. Three Toffoli gates has been used for detecting the presence of three edges in every combination. One Toffoli gates is used for clique detection. The input graph has two cliques of size 3. So maximum clique of the graph of Fig 12 is 3.

\subsection{Circuit for finding maximum clique of size 4 in a graph }
\par The following graph in the Fig. 14 has four vertices. This is a complete graph with four vertices and six edges. Each vertex is represented by their binary equivalent. As we are going to find clique of size 4, total number of qubit required is $4*log_2(4)$=8. The total number of combination is $4 \choose 4$ that is one. The combination is {$\ket{00}$,$\ket{01}$,$\ket{10}$,$\ket{11}$}. Hadamard gates are applied parallely to the input qubits and output qubit. Qubits are activated using NOT gates to the 0 qubits. All vertices are connected in the graph. So there are 6 Toffoli gates for edge detection and one Toffoli gate for edge detection.

\begin{figure}[h]
\centering
\includegraphics[width= 1.5in]{example3.png}
\fcaption{Graph with clique size 4}
\end{figure}

  Circuit for checking clique of size four is shown in the Fig 15.
\begin{figure}[h]
\centering
\includegraphics[width= 3in]{ckt4clique.png}
\fcaption{circuit for checking the presence of clique size 4}
\end{figure}
\justify

\section{Mathematical Formulation of Oracle for \textit{k}-clique Problem}
Generalization of Oracle is already well established in section 3. This section shows how an arbitrary graph formulates the proposed Oracle.
Let us consider a graph in Fig 11, there are $4$ vertices in the input graph. The Oracle checks a combination of three vertices at a time to determine if a clique is formed by them. Each vertex is represented by 2 qubits. Hence, a total $m=3*2=6$ input qubit lines are required for input. Let us consider the circuit given in Fig 12 for finding triangle in the graph.
\subsection{Initialization}
The input qubits are initialized with $\ket{0}$. Ancilla qubits are initialized with $\ket{0}$. Output qubit is initialized with $\ket{1}$. Entire initialization can be mathematically written as:
\[\vert\psi\rangle\otimes\vert\theta\rangle\otimes\vert\phi\rangle=\vert 0\rangle^{\otimes 6}\otimes\vert 0\rangle^{\otimes 4}\otimes\vert 1\rangle\]

\subsection{Hadamard Transformation}
After the initialization, the Hadamard transform $H^{\otimes 6}$ on input qubits and $H$ on output qubit is performed, therefore all possible states are superposed as $\ket{\psi_{0}}\otimes\ket{\theta_{0}}\otimes\ket{\phi_{0}}$, where

\[\vert\psi_{0}\rangle=\,{1\over\sqrt{2^{6}}}\sum_{i=0}^{2^{6}-1}\vert i\rangle\]

\[\ket{\theta_{0}}=\ket{0000}\]

\[\vert\phi_{0}\rangle=\,{1\over\sqrt{2}}\left(\vert 0\rangle-\vert 1\rangle\right)\]

\[\vert\psi_{0}\rangle\otimes\vert\theta_{0}\rangle\otimes\vert\phi_{0}\rangle={1\over\sqrt{2^{6}}}\sum_{i=0}^{2^{6}-1}\vert i\rangle\otimes\vert 0\rangle^{\otimes 4}\otimes{1\over\sqrt{2}}\left(\vert 0\rangle-\vert 1\rangle\right)\]

\[\implies {\frac{1}{\sqrt{2^{6}}}}(\ket{000000}+ ..... + \ket{111111})\otimes\vert 0\rangle^{\otimes 4}\otimes{1\over\sqrt{2}}\left(\vert 0\rangle-\vert 1\rangle\right) \]

\[\implies {1\over\sqrt{2^{7}}}(\ket{00000000000}+\ket{00000100000}+ ..... + \ket{11111100000})\] \[+{1\over\sqrt{2^{7}}}(-\ket{00000000001}-\ket{00000100001}- ..... - \ket{11111100001})\]
\justify
\subsection{Oracle}
\begin{itemize}
\item \textbf{1st combination of vertices $\ket{000110}$}:-
\begin{enumerate}

\item \textbf{Search space reduction using qubit activation}:- After Applying NOT gates to the 1st, 2nd, 3rd and 6th qubit of all superposed states. The result yields \\$ \psi_{0}= {\frac{1}{\sqrt{2^{7}}}} (\ket{11100100000}+\ket{11100000000}+ \ket{11101100000} +\ket{11101000000}+ \ket{11110100000} + \ket{11110000000}+\ket{11110000000} +\mathbf{\ket{11111100000}}+.....+\ket{00011000000})+{1\over\sqrt{2^{7}}}(-\ket{11100100001}-\ket{11100000001}- ......\mathbf{\ket{11111100001}}.. - \ket{00011000001})$

\item \textbf{Edge detection}:- Two Toffoli gates are applied between vertices ($\ket{00}$ ,$\ket{10}$) and $\ket{01}$,$\ket{10}$ for two edges. The result yields  \\ $\psi_{1}= {\frac{1}{\sqrt{2^{7}}}} (\ket{11100100000}+\ket{11100000000}+ \ket{11101100000} +\ket{11101000000}+ \ket{11110100000} + \ket{11110000000}+\ket{11110000000} +\mathbf{\ket{11111111000}}+...+\ket{11111100000})+{1\over\sqrt{2^{7}}}(-\ket{11100100001}-\ket{11100000001}- ...\mathbf{\ket{11111111001}}.. - \ket{00011000001})$

\item \textbf{Clique detection}:- Fourth Toffoli gate flips fourth ancilla qubit, if three ancilla qubits are 1. The result yields \\ $\psi_{2}= {\frac{1}{\sqrt{2^{7}}}} (\ket{11100100000}+\ket{11100000000}+ \ket{11101100000} +\ket{11101000000}+ \ket{11110100000} + \ket{11110000000}+\ket{11110000000} +\mathbf{\ket{11111111000}}+...+\ket{11111100000})+{1\over\sqrt{2^{7}}}(-\ket{11100100001}-\ket{11100000001}- ...\mathbf{\ket{11111111001}}.. - \ket{00011000001})$
\item\textbf{Mirror circuit for 1st combination}:\\
 $\psi_{3}={\frac{1}{\sqrt{2^{7}}}} \ket{00000000000}+\ket{00000100000}+ \ket{00001000000} +\ket{00001100000}
\ket{00010000000} + \ket{00010100000}+\ket{00010100000}+\mathbf{\ket{00011000000}} +\ket{00011100000}++...+\ket{11111100000})+{1\over\sqrt{2^{7}}}(-\ket{00000000001}-\ket{00000100001}- ...\mathbf{\ket{00011000001}}.. - \ket{11111100001})$
\end{enumerate}
\item \textbf{2nd combination of vertices $\ket{001011}$}. \\
\begin{enumerate}

\item \textbf{Search space reduction using qubit activation}:- After Applying NOT gates to the 1st,2nd and 4th qubit of all superposed states, The result yields\\
$\psi_{4}={\frac{1}{\sqrt{2^{7}}}} \ket{11010000000}+\ket{11010100000}+ \ket{11011000000} +\ket{11001100000} +...+\mathbf{\ket{11000000000}}+...\mathbf{\ket{11111100000}} .....+\ket{00101100000})+{1\over\sqrt{2^{7}}}(-\ket{11010000001}-\ket{11010100001}- .\\.\mathbf{\ket{11001000001}}....\mathbf{\ket{11111100001}}..-..... - \ket{00101100001})$

\item \textbf{Edge Detection}:-Three Toffoli gates are applied between vertices ($\ket{00}$ ,$\ket{10}$), ($\ket{01}$,$\ket{10}$) and ($\ket{00}$,$\ket{01}$) for three edges. The result yields\\
 $\psi_{5}={\frac{1}{\sqrt{2^{7}}}} \ket{11010000000}+\ket{11010100000}+ \ket{11011000000} +\ket{11001100000} +...+\mathbf{\ket{11001000000}}+...\mathbf{\ket{11111111100}} .....+\ket{00101100000})+{1\over\sqrt{2^{7}}}(-\ket{11010000001}-\ket{11010100001}- ..\mathbf{\ket{11001000001}}...\\.\mathbf{\ket{11111111101}}..-..... - \ket{00101100001})$
\item \textbf{Clique Detection}:- Fourth Toffoli gate Flips fourth ancilla qubit if three ancilla qubits are one. The result yields\\
 $\psi_{6}={\frac{1}{\sqrt{2^{7}}}} \ket{11010000000}+\ket{11010100000}+ \ket{11011000000} +\ket{11001100000} +...+\mathbf{\ket{11001000000}}+...\mathbf{\ket{11111111110}} .....+\ket{0010110000})+{1\over\sqrt{2^{7}}}(-\ket{11010000001}-\ket{11010100001}- .\\.\mathbf{\ket{11001000001}}....\mathbf{\ket{11111111111}}..-..... - \ket{00101100001})$
\item \textbf{After mirror circuit of 2nd combination} \\
 $\psi_{7}={\frac{1}{\sqrt{2^{7}}}} \ket{00000000000}+\ket{00000100000}+ \ket{00001000000}...\mathbf{\ket{00011000000}}.....\mathbf{\ket{00101100010}} .....+\ket{11111100000})+{1\over\sqrt{2^{7}}}(-\ket{00000000001}-\ket{00000100001}- ..\mathbf{\ket{00011000001}}....\mathbf{\ket{00101100011}}..-..... - \ket{11111100001})$
\end{enumerate}
\item \textbf{3rd combination $\ket{011011}$}:\\
\begin{enumerate}
\item \textbf{Search space reduction using qubit activation}:-After Applying NOT gates to the 1st and 4th qubit of all superposed states, the result yields \\ $\psi_{8}= {\frac{1}{\sqrt{2^{7}}}} \ket{10010000000}+\ket{10010100000}+ \ket{10011000000}...\mathbf{\ket{10001000000}}...+\mathbf{\ket{10111100010}} ...\\..\mathbf{\ket{11111100000}}+....+\ket{01101100000}) +{1\over\sqrt{2^{7}}}(-\ket{10010000001}-\ket{10010100001}- ...\mathbf{\ket{10001000001}}-\mathbf{\ket{10111100011}}..-\mathbf{\ket{11111100001}}... - \ket{01101100001})$

\item \textbf{Edge Detection}:- Two Toffoli gates are applied between vertices ($\ket{01}$,$\ket{11}$) and ($\ket{10}$,$\ket{11}$) for two edges. The result yields \\
 $\psi_{9}={\frac{1}{\sqrt{2^{7}}}} \ket{10010000000}+\ket{10010100000}+ \ket{10011000000}...\mathbf{\ket{10001000000}}...\mathbf{\ket{10111100010}}..\\ ..\mathbf{\ket{11111111000}}+....+\ket{01101100000}) +{1\over\sqrt{2^{7}}}(-\ket{10010000001}-\ket{10010100001}- ...\mathbf{\ket{10001000001}}-\mathbf{\ket{10111100011}}..-\mathbf{\ket{11111111001}}... - \ket{01101100001})$

 \item \textbf{Clique Detection}:-Fourth Toffoli gate Flips fourth ancilla qubit if three ancilla qubits are 1. The result yields \\
 $\psi_{10}={\frac{1}{\sqrt{2^{7}}}} \ket{10010000000}+\ket{10010100000}+ \ket{10011000000}...\mathbf{\ket{10001000000}}...\mathbf{\ket{10111100010}} ..\\..\mathbf{\ket{11111111000}}+....+\ket{01101100000}) +{1\over\sqrt{2^{7}}}(-\ket{10010000001}-\ket{10010100001}- ...\mathbf{\ket{10001000001}}-\mathbf{\ket{10111100011}}..-\mathbf{\ket{11111111001}}... - \ket{01101100001})$
\item \textbf{Mirror circuit of 3rd combination}\\
$\psi_{11}={\frac{1}{\sqrt{2^{7}}}} \ket{00000000000}+\ket{00000100000}+ ..+\mathbf{\ket{00011000000}}+.. +\mathbf{\ket{00101100010}} ..\\..+\mathbf{\ket{01101100000}}+..+\ket{11111100000})+{1\over\sqrt{2^{7}}}(-\ket{00000000001}-\ket{00000100001}- ...\mathbf{\ket{00011000001}}-\mathbf{\ket{00101100011}}.....\\.\mathbf{\ket{01101100001}}.... - \ket{11111100001})$

\end{enumerate}
\item \textbf{4th combination for the input qubits $\ket{000111}$} \\
\begin{enumerate}

\item \textbf{Search space reduction using qubit activation}:- After applying NOT gates to the 1st, 2nd and 3rd qubits of all superposed states. The result yields \\
$\psi_{12}={\frac{1}{\sqrt{2^{7}}}} \ket{11100000000}+\ket{11100100000}+ ..+\mathbf{\ket{11111000000}}+...\mathbf{\ket{11111100000}}.. +\mathbf{\ket{11001100010}} ..+\mathbf{\ket{10001100000}}+....+\ket{11111100000})+{1\over\sqrt{2^{7}}}(-\ket{00000000001}-\ket{00000100001}- ..\\.\mathbf{\ket{00011000001}}-....\mathbf{\ket{11111100000}}..\mathbf{\ket{00101100011}}......\mathbf{\ket{01101100001}}.... - \ket{11111100001})$

\item \textbf{Edge Detection}:- Three Toffoli Gates are applied between the vertices  \\ ($\ket{00}\ket{01}$); ($\ket{00}\ket{10}$);($\ket{01}\ket{10}$);($\ket{10}\ket{11}$) for three edges. The result yields\\
$\psi_{13}={\frac{1}{\sqrt{2^{7}}}} \ket{11100000000}+\ket{11100100000}+ ..+\mathbf{\ket{11111000000}}+...\mathbf{\ket{11111111100}}.. +\mathbf{\ket{11001100010}} ..+\mathbf{\ket{10001100000}}+....+\ket{11111100000})+{1\over\sqrt{2^{7}}}(-\ket{00000000001}-\ket{00000100001}- ...\mathbf{\ket{00011000001}}-....-\mathbf{\ket{11111111100}}..\mathbf{\ket{00101100011}}......\mathbf{\ket{01101100001}}.... - \ket{11111100001})$
\item \textbf{Clique Detection}:- Fourth Toffoli gate Flips fourth ancilla qubit if three ancilla qubits are 1. The result yields \\ $\psi_{14}={\frac{1}{\sqrt{2^{7}}}} \ket{11100000000}+\ket{11100100000}+ ..+\mathbf{\ket{11111000000}}+...\mathbf{\ket{11111111110}}.. +\mathbf{\ket{11001100010}} ..+\mathbf{\ket{10001100000}}+....+\ket{11111100000})+{1\over\sqrt{2^{7}}}(-\ket{00000000001}-\ket{00000100001}- ...\mathbf{\ket{00011000001}}-....-\mathbf{\ket{11111111111}}..\mathbf{\ket{00101100011}}......\mathbf{\ket{01101100001}}.... - \ket{11111100001})$
\item \textbf{Mirror circuit of 4th combination}:-\\
$\psi_{15}={\frac{1}{\sqrt{2^{7}}}} \ket{00000000000}+\ket{00000100000}+ ..+\mathbf{\ket{00011000000}}+.. +\mathbf{\ket{00101100010}} ...+\mathbf{\ket{00011100010}}....+\mathbf{\ket{01101100000}}+..+\ket{11111100000})+{1\over\sqrt{2^{7}}}(-\ket{00000000001}-\ket{00000100001}- ...\mathbf{\ket{00011000001}}-....-\mathbf{\ket{00011100011}}...\mathbf{\ket{00101100011}}......\mathbf{\ket{01101100001}}.... - \ket{11111100001})$

\end{enumerate}
\end{itemize}
\subsection{Flip the output qubit} CNOT gate is applied on the output qubit with the fourth Toffoli gate as control. Output qubit of the two states $\ket{001011}$ and $\ket{000111}$ are high after the operation.\par
$ \psi_{16}={\frac{1}{\sqrt{2^{7}}}} \ket{00000000000}+\ket{00000100000}+ ..+\mathbf{\ket{00011000000}}+.. +\mathbf{\ket{00101100011}} ...+\mathbf{\ket{00011100011}}....+\mathbf{\ket{01101100000}}+..+\ket{11111100000})+{1\over\sqrt{2^{7}}}(-\ket{00000000001}-\ket{00000100001}- ...\mathbf{\ket{00011000001}}-....-\mathbf{\ket{00011100010}}...\mathbf{\ket{00101100010}}......\mathbf{\ket{01101100001}}.... - \ket{11111100001})$

\subsection{Hadamard gate on output qubit}
$\psi_{17}= {\frac{1}{\sqrt{2^{7}}}} (\ket{00000000001}+\ket{00000100001}+ .\ket{00011000001} ..+\ket{01101100001}...+\ket{11111100001})+{1\over\sqrt{2^{7}}}(...-\mathbf{\ket{00011100011}}...-\mathbf{\ket{00101100011}})$
\par We can see that two marked states $\ket{000111}$ and $\ket{001011}$ are with negative amplitude only. Now grover's diffusion operator, perform the inversion about the average of all amplitudes of the quantum state for a certain number of iterations to get the amplitude of the marked state large enough. So the amplitude of the marked states becomes higher than other states.

\section{Cost analysis of the Circuit}
\subsection{Query Cost}
Cost of the circuit depends on the number of the input lines, ancilla lines and the number of gates used. Let there are n number of inputs $(X_1;...;X_n)$. If the circuit is designed for $k$ sized clique, then total combination is $n \choose k$. Each vertex is represented by $\ceil{log_2n}$ qubits. So for detecting an edge between two vertices we need a Toffoli gate with $2*\ceil{log_2n}$ control qubits. For detection of clique of size \textit{k}, we have to check whether the subgraph formed by the \textit{k} vertices is complete. Maximum number of edges of a graph with \textit{k} vertices is $k \choose 2$. So we need Toffoli gate with $k \choose 2$ control qubits. The following table 3 shows the maximum number controls in the MCT gates and ancilla qubits for finding \textit{k}-clique.
\begin{table}[htb]
\tcaption{Quantum Cost Analysis Of k-Clique Problem}
\centering
\begin{tabular}{| c | c | c | }
 \hline
 No of vertices & No of ancilla qubits & Maximum number of controls in the MCT Gate \\
 \hline
   n & $k \choose 2$ + 2 &  \shortstack{Edge detection=$2*\ceil{log_2n}$,\\ Clique detection=$k \choose 2$}\\
  \hline
\end{tabular}

\end{table}
The cost for the circuit of for finding 3-clique and 4-clique are shown in the table 4.
\begin{table}[htb]
\tcaption{Quantum Cost Analysis of the circuit of figure 12 and 15}
\centering
\begin{tabular}{ | c | c | c | c | }
 \hline
 Clique size & No of vertices & No of ancilla qubits & Number of controls in the MCT Gate \\
 \hline
  $4 $ &  4 & ${4 \choose 2} +2=8$ & \shortstack{Edge detection=$2*\ceil{log_24}=4$,\\ Clique detection=${4 \choose 2}=6$}\\
 \hline
  $3 $ & 4 & ${4 \choose 3} +2=5$ &  \shortstack{Edge detection=$2*\ceil{log_24}=4$,\\ Clique detection=$3 \choose 2$=3}\\

 \hline
\end{tabular}

\end{table}

\section{Simulation Results using QISKit}
The quantum circuit for finding clique of size 4(Fig. 15) and size 3(Fig. 12) is simulated in $IBMQ\_Qasm\_Simulator$ for verification. The Qiskit code for generating the simulation graphs is given in the github. The link is https://github.com/abhaduri77/k-clique-code.git

\subsection{Simulation of clique size 4 in IBMQ}
In figure 15 we have 8 qubit lines for input, there can be a total of $2^8=256$ different qubit combinations as $\ket{000000000}$, $\ket{000000001}$, $\dots$, $\ket{11111111}$ after applying Hadamard gate to all input qubits. Hence, the database on which Grover's algorithm is applied contains 256 different elements. Fig. 15 shows the complete gate level synthesis of the Grover's circuit for 4-clique problem. The simulation steps on $IBMQ\_Qasm\_Simulator$\cite{28} required for the synthesis of Fig.15 are as follows:
 \begin{enumerate}
\item The Oracle checks if two vertices are adjacent and determines if a clique is formed by a four-vertex combination. Four-vertex combinations are $\ket{00011011}$. It then inverts the amplitude of the solution state for which the vertex combination forms a clique. The solution states for this case are $\ket{00011011}$.
\item The output of the Oracle is acted upon by the Grover's diffusion operator shown in Fig. 16. The diffusion operator amplifies the amplitude of the marked solution state.
\item Steps 1 and 2 constitute the Grover operator for the Grover's search algorithm. Hence, these two steps are repeated $\dfrac{\pi}{4}\sqrt{256}$ times. (For an $N$ item database with $M$ solutions, Grover's iteration must be repeated $\dfrac{\pi}{4}\sqrt{\dfrac{N}{M}}$ times in order to obtain a solution.
\end{enumerate}
The resultant output after applying Grover's operator $\dfrac{\pi}{4}\sqrt{256}$ times is shown in Fig. 16 where the amplitude of the solution state has been amplified. The location of the solution state is $\ket{00011011}$, which is the vertex combination in an example graph of figure 14 that forms clique with high probability.The circuit for clique size four has been simulated in $IBMQ\_Qasm\_Simulator$. The marked state $\ket{00011011}$ is high as shown in the output plot below.
\begin{figure}[h]
\centering
\includegraphics[width =6in]{4c4output_new.png}
\fcaption{Marked States After Applying Diffusion Operator}
\end{figure}
\subsection{Simulation of clique size 3 in IBMQ}
 In figure 13, we have 6 qubit lines for input, there can be a total of $2^6=64$ different qubit combinations as $\ket{0000000}$, $\ket{0000001}$, $\dots$, $\ket{111111}$ after applying Hadamard gate to all input qubits. Hence, the database on which Grover's algorithm is applied contains 64 different elements. Fig.13 shows the complete gate level synthesis of the Grover's circuit for 3-clique problem. The simulation steps on $$IBMQ\_Qasm\_Simulator$$ \cite{31} required for the synthesis of Fig. 13 are as follows:
 \begin{enumerate}
\item The Oracle checks if two vertices are adjacent and determines if a clique is formed by a three-vertex combination. Three-vertex combinations are $\ket{000110}$, $\ket{001011}$, $\ket{000111}$ and $\ket{011011}$. It then inverts the amplitude of the solution state for which the vertex combination forms a clique. The solution states for this case are $\ket{001011}$ and $\ket{000111}$.
\item The output of the Oracle is acted upon by the Grover's diffusion operator shown in Fig 17. The diffusion operator amplifies the amplitude of the marked solution state.
\item Steps 1 and 2 constitute the Grover operator for the Grover's search algorithm. Hence, these two steps are repeated $\dfrac{\pi}{4}\sqrt{32}$ times. (For an $N$ item database wit $M$ solutions, Grover's iteration must be repeated $\dfrac{\pi}{4}\sqrt{\dfrac{N}{M}}$ times in order to obtain a solution).
\end{enumerate}
The resultant output after applying Grover's operator $\dfrac{\pi}{4}\sqrt{32}$ times is shown in Fig. 17 where the amplitude of the solution state has been amplified. The location of the solution states are $\ket{000111}$ and $\ket{001011}$, which are the vertex combination in an example graph Fig. 12 that forms clique with high probability.
\begin{figure}[h]
\centering
\includegraphics[width =6in]{4c3output_new.png}
\fcaption{Marked States After Applying Diffusion Operator}

\end{figure}

\section{Complexity Analysis}
A quantum algorithm always gives quadratic speed up over its classical counterpart.
\subsection{Query Complexity} Proposed quantum algorithm for the synthesis of \textit{k}-Clique Problem in this paper is based on Grover's algorithm. So quadratic speed up is achieved using this combinatorial approach. Total number of input verices is $n$ and clique size is \textit{k}.  For representing each vertex we need $\ceil{log_2n}$ qubits. So total number of input qubit lines is $k*\ceil{log_2n}$. Grover's algorithm finds clique with probability at least $\frac{1}{2}$ in only $O(\sqrt{2^{k*log_2n}})$ queries.\\
Let us take the circuit of figure 13 for finding triangle in a graph. Total number of combinations is 4. Each vertex is represented using 2 qubits as $n=4$. So total number of input qubit lines is 6. So query complexity is $O(\sqrt{2^6})$.

\section{Conclusion}

The automated and generalized algorithm of quantum circuit synthesis for \textit{k}-Clique Problem for any given undirected and unweighted graph has been proposed with a query complexity of $O(\sqrt{2^{k*log_2n}})$. The algorithm for \textit{k}-clique problem is further used for triangle finding problem and maximum clique problem. Algorithm for both the problems has been discussed in this paper. Complexity of the algorithm has been analysed and circuit cost has been estimated. Two arbitrary graphs of different clique sizes have been taken for verifying the circuit. The circuit is implemented in IBMQ Qasm Simulator and can be mapped to any NISQ devices. In future we plan to adopt, some technology specific error control schemes which can be applied to satisfy the physical implementation requirements of these circuits. In future scope of this paper, we will try to reduce the number of gates and qubits cost to implement clique problem. This will help one to implement clique problem for more larger graphs.
\justify
\renewenvironment{thebibliography}[1]
        {\frenchspacing
         \small\rm\baselineskip=11pt
         \begin{list}{\arabic{enumi}.}
        {\usecounter{enumi}\setlength{\parsep}{0pt}
         \setlength{\leftmargin}{17pt}
                \setlength{\rightmargin}{0pt}
         \setlength{\itemsep}{0pt} \settowidth
          {\labelwidth}{#1.}\sloppy}}{\end{list}}
\nonumsection{References}
\noindent

redpajama_set_name: RedPajamaArXiv


text:
@interface CatLimitQueue : NSObject
{

}
@property (nonatomic, assign) NSInteger maxCount;
@property (atomic, readonly) NSMutableArray *queue;

- (id)init;
- (id)initWithArray:(NSArray *)array;
- (id)dequeue;
- (id)enqueue:(id)obj;
- (void)removeByEqualMethod:(id)obj;

@end

redpajama_set_name: RedPajamaGithub