<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-init="VerticalStudentView" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Deutsch-Josza_algorithm__1_of_2_" data-request-token="5efd5e471eda11f097b012192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="vertical">
<h2 class="hd hd-2 unit-title">Deutsch-Josza algorithm (1 of 2)</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Deutsch-Josza_algorithm_I">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Deutsch-Josza_algorithm_I" data-request-token="5efd5e471eda11f097b012192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="problem">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_Deutsch-Josza_algorithm_I" class="problems-wrapper" role="group"
aria-labelledby="Deutsch-Josza_algorithm_I-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Deutsch-Josza_algorithm_I" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@Deutsch-Josza_algorithm_I/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="3"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="Deutsch-Josza_algorithm_I-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Deutsch-Josza_algorithm_I-problem-progress" tabindex="-1">
Deutsch-Josza algorithm I
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Deutsch-Josza_algorithm_I-problem-progress"></div>
<div class="problem">
<div>
<div id="fig1" class="figure">
<center>
<img src="/assets/courseware/v1/c6adf0427cde25ac7af2cfb663713ed7/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_ps3a_DJ.png" width="400" style="scale:0.5"/>
</center>
<div class="caption"><b>Figure 1</b>: <span>Deutsch-Josza algorithm</span></div>
</div>
<p>
The Deutsch-Josza algorithm allows one to determine whether a function over [mathjaxinline]n[/mathjaxinline] bit string [mathjaxinline]f: \{ 0,1\} ^ n \rightarrow \{ 0,1\}[/mathjaxinline] is constant or balanced by only one application of unitary. [mathjaxinline]f[/mathjaxinline] is constant if [mathjaxinline]f(x) = c[/mathjaxinline] for all [mathjaxinline]x\in \{ 0,1\} ^ n[/mathjaxinline] for some constant [mathjaxinline]c\in \{ 0,1\}[/mathjaxinline]. [mathjaxinline]f[/mathjaxinline] is balanced if [mathjaxinline]f(x)=0[/mathjaxinline] for [mathjaxinline]2^{n-1}[/mathjaxinline] [mathjaxinline]x[/mathjaxinline]'s and [mathjaxinline]f(x)=1[/mathjaxinline] for the other [mathjaxinline]2^{n-1}[/mathjaxinline] [mathjaxinline]x[/mathjaxinline]'s. </p>
<p>
Let [mathjaxinline]U[/mathjaxinline] be a unitary such that [mathjaxinline]U|{x}\rangle |{y}\rangle =|{x}\rangle |{y\oplus f(x)}\rangle[/mathjaxinline]. The circuit for the Deutsch-Josza algorithm is depicted in the figure above. The top wire refers to the [mathjaxinline]n[/mathjaxinline]-qubit wires and the Hadamard gate is applied to each qubit. The measurement at the end is done for each qubit with [mathjaxinline]\{ |{0}\rangle , |{1}\rangle \}[/mathjaxinline] basis. We call the first [mathjaxinline]n[/mathjaxinline] qubits "data qubits" and the last one qubit "work qubit". </p>
<p>
In this problem, we consider specific examples for [mathjaxinline]n=2[/mathjaxinline]. </p>
<p>
Let [mathjaxinline]f(x)=x\cdot j[/mathjaxinline] where [mathjaxinline]j=00[/mathjaxinline]. We define inner product between [mathjaxinline]n[/mathjaxinline] digit numbers [mathjaxinline]a=a_1a_2\dots a_ n[/mathjaxinline] and [mathjaxinline]b=b_1b_2\dots b_ n[/mathjaxinline] as [mathjaxinline]a\cdot b=\sum _{i=1}^ n a_ i b_ i[/mathjaxinline]. </p>
<ul class="itemize">
<li>
<p>
Is this [mathjaxinline]f[/mathjaxinline] constant or balanced? </p>
<p>
<div class="inline" tabindex="-1" aria-label="Question 1" role="group"><div class="inputtype option-input inline">
<select name="input_Deutsch-Josza_algorithm_I_2_1" id="input_Deutsch-Josza_algorithm_I_2_1" aria-describedby="status_Deutsch-Josza_algorithm_I_2_1">
<option value="option_Deutsch-Josza_algorithm_I_2_1_dummy_default">Select an option</option>
<option value="constant"> constant</option>
<option value="balanced"> balanced</option>
</select>
<div class="indicator-container">
<span class="status unanswered" id="status_Deutsch-Josza_algorithm_I_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
<p class="answer" id="answer_Deutsch-Josza_algorithm_I_2_1"/>
</div></div>
</p>
</li>
<li>
<p>
Write the state of data qubits right after the application of [mathjaxinline]U[/mathjaxinline] with [mathjaxinline]\{ |{00}\rangle ,|{01}\rangle ,|{10}\rangle ,|{11}\rangle \}[/mathjaxinline] basis. Choose the global phase so that the coefficients are real. </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 2" role="group"><div id="inputtype_Deutsch-Josza_algorithm_I_3_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Deutsch-Josza_algorithm_I_3_1" id="input_Deutsch-Josza_algorithm_I_3_1" aria-describedby="status_Deutsch-Josza_algorithm_I_3_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Deutsch-Josza_algorithm_I_3_1"/>
<span class="status unanswered" id="status_Deutsch-Josza_algorithm_I_3_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Deutsch-Josza_algorithm_I_3_1" class="answer"/>
<div id="display_Deutsch-Josza_algorithm_I_3_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Deutsch-Josza_algorithm_I_3_1_dynamath" name="input_Deutsch-Josza_algorithm_I_3_1_dynamath"/>
</div>
</div></div>
</p>
</li>
<li>
<p>
What is the probability of getting measurement result 00? </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 3" role="group"><div id="inputtype_Deutsch-Josza_algorithm_I_4_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Deutsch-Josza_algorithm_I_4_1" id="input_Deutsch-Josza_algorithm_I_4_1" aria-describedby="status_Deutsch-Josza_algorithm_I_4_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Deutsch-Josza_algorithm_I_4_1"/>
<span class="status unanswered" id="status_Deutsch-Josza_algorithm_I_4_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Deutsch-Josza_algorithm_I_4_1" class="answer"/>
<div id="display_Deutsch-Josza_algorithm_I_4_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Deutsch-Josza_algorithm_I_4_1_dynamath" name="input_Deutsch-Josza_algorithm_I_4_1_dynamath"/>
</div>
</div></div>
</p>
</li>
</ul>
<p>
<div class="solution-span">
<span id="solution_Deutsch-Josza_algorithm_I_solution_1"/>
</div></p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Deutsch-Josza algorithm I" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_Deutsch-Josza_algorithm_I" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_Deutsch-Josza_algorithm_I">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Deutsch-Josza_algorithm_I-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Deutsch-Josza_algorithm_I-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Deutsch-Josza_algorithm_I-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box3x">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box3x" data-request-token="5efd5e471eda11f097b012192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="html">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-init="VerticalStudentView" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Deutsch-Josza_algorithm__2_of_2_" data-request-token="5efd5e471eda11f097b012192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="vertical">
<h2 class="hd hd-2 unit-title">Deutsch-Josza algorithm (2 of 2)</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Deutsch-Josza_algorithm_II">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Deutsch-Josza_algorithm_II" data-request-token="5efd5e471eda11f097b012192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="problem">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_Deutsch-Josza_algorithm_II" class="problems-wrapper" role="group"
aria-labelledby="Deutsch-Josza_algorithm_II-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Deutsch-Josza_algorithm_II" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@Deutsch-Josza_algorithm_II/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="3"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="Deutsch-Josza_algorithm_II-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Deutsch-Josza_algorithm_II-problem-progress" tabindex="-1">
Deutsch-Josza algorithm II
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Deutsch-Josza_algorithm_II-problem-progress"></div>
<div class="problem">
<div>
<p>
Continuing in the scenario of the Deutsch-Jozsa algorithm problem part I: </p>
<div id="fig2" class="figure">
<center>
<img src="/assets/courseware/v1/c6adf0427cde25ac7af2cfb663713ed7/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_ps3a_DJ.png" width="400" style="scale:0.5"/>
</center>
<div class="caption"><b>Figure 2</b>: <span>Deutsch-Josza algorithm</span></div>
</div>
<ul class="itemize">
<li>
<p>
Let [mathjaxinline]f(x)=x\cdot j[/mathjaxinline] where [mathjaxinline]j=01[/mathjaxinline]. We define inner product between [mathjaxinline]n[/mathjaxinline] digit numbers [mathjaxinline]a=a_1a_2\dots a_ n[/mathjaxinline] and [mathjaxinline]b=b_1b_2\dots b_ n[/mathjaxinline] as [mathjaxinline]a\cdot b=\sum _{i=1}^ n a_ i b_ i[/mathjaxinline]. </p>
<ul class="itemize">
<li>
<p>
Is this [mathjaxinline]f[/mathjaxinline] constant or balanced? </p>
<p>
<div class="inline" tabindex="-1" aria-label="Question 1" role="group"><div class="inputtype option-input inline">
<select name="input_Deutsch-Josza_algorithm_II_2_1" id="input_Deutsch-Josza_algorithm_II_2_1" aria-describedby="status_Deutsch-Josza_algorithm_II_2_1">
<option value="option_Deutsch-Josza_algorithm_II_2_1_dummy_default">Select an option</option>
<option value="constant"> constant</option>
<option value="balanced"> balanced</option>
</select>
<div class="indicator-container">
<span class="status unanswered" id="status_Deutsch-Josza_algorithm_II_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
<p class="answer" id="answer_Deutsch-Josza_algorithm_II_2_1"/>
</div></div>
</p>
</li>
<li>
<p>
Write the state of data qubits right after the application of [mathjaxinline]U[/mathjaxinline] with [mathjaxinline]\{ |{00}\rangle ,|{01}\rangle ,|{10}\rangle ,|{11}\rangle \}[/mathjaxinline] basis. Choose the global phase so that the coefficients are real. </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 2" role="group"><div id="inputtype_Deutsch-Josza_algorithm_II_3_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Deutsch-Josza_algorithm_II_3_1" id="input_Deutsch-Josza_algorithm_II_3_1" aria-describedby="status_Deutsch-Josza_algorithm_II_3_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Deutsch-Josza_algorithm_II_3_1"/>
<span class="status unanswered" id="status_Deutsch-Josza_algorithm_II_3_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Deutsch-Josza_algorithm_II_3_1" class="answer"/>
<div id="display_Deutsch-Josza_algorithm_II_3_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Deutsch-Josza_algorithm_II_3_1_dynamath" name="input_Deutsch-Josza_algorithm_II_3_1_dynamath"/>
</div>
</div></div>
</p>
</li>
<li>
<p>
What is the probability of getting measurement result 00? </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 3" role="group"><div id="inputtype_Deutsch-Josza_algorithm_II_4_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Deutsch-Josza_algorithm_II_4_1" id="input_Deutsch-Josza_algorithm_II_4_1" aria-describedby="status_Deutsch-Josza_algorithm_II_4_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Deutsch-Josza_algorithm_II_4_1"/>
<span class="status unanswered" id="status_Deutsch-Josza_algorithm_II_4_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Deutsch-Josza_algorithm_II_4_1" class="answer"/>
<div id="display_Deutsch-Josza_algorithm_II_4_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Deutsch-Josza_algorithm_II_4_1_dynamath" name="input_Deutsch-Josza_algorithm_II_4_1_dynamath"/>
</div>
</div></div>
</p>
</li>
</ul>
</li>
</ul>
<p>
<div class="solution-span">
<span id="solution_Deutsch-Josza_algorithm_II_solution_1"/>
</div></p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Deutsch-Josza algorithm II" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_Deutsch-Josza_algorithm_II" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_Deutsch-Josza_algorithm_II">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Deutsch-Josza_algorithm_II-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Deutsch-Josza_algorithm_II-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Deutsch-Josza_algorithm_II-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-init="VerticalStudentView" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Simons_algorithm__1_of_2_" data-request-token="5efd5e471eda11f097b012192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="vertical">
<h2 class="hd hd-2 unit-title">Simon's algorithm (1 of 2)</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Simons_algorithm_I">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Simons_algorithm_I" data-request-token="5efd5e471eda11f097b012192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="problem">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_Simons_algorithm_I" class="problems-wrapper" role="group"
aria-labelledby="Simons_algorithm_I-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Simons_algorithm_I" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@Simons_algorithm_I/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="3"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="Simons_algorithm_I-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Simons_algorithm_I-problem-progress" tabindex="-1">
Simon&#39;s algorithm I
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Simons_algorithm_I-problem-progress"></div>
<div class="problem">
<div>
<p>
Let [mathjaxinline]f:\{ 0,1\} ^ n \rightarrow \{ 0,1\} ^ n[/mathjaxinline] be a function over [mathjaxinline]n[/mathjaxinline] bits whose output is also [mathjaxinline]n[/mathjaxinline] bit. Suppose that [mathjaxinline]f[/mathjaxinline] is a function such that [mathjaxinline]f(x)=f(y)[/mathjaxinline] if and only if [mathjaxinline]x \oplus s = y[/mathjaxinline] for fixed [mathjaxinline]n[/mathjaxinline] bit string [mathjaxinline]s[/mathjaxinline]. Note that [mathjaxinline]\oplus[/mathjaxinline] is the bitwise addition modulo 2. Classically, finding such [mathjaxinline]s[/mathjaxinline] takes exponentially many queries to a classical oracle which outputs [mathjaxinline]f(x)[/mathjaxinline] for input [mathjaxinline]x[/mathjaxinline]. Simon's algorithm is a quantum algorithm that allows one to reduce the number of queries to polynomially many times. The circuit for the Simon's algorithm is shown below. </p>
<div class="figure" id="fig2">
<center>
<img src="/assets/courseware/v1/fbf484cab02a02017edae9ba8d55ea53/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_ps3b_simon.png" width="400" style="scale:0.7"/>
</center>
</div>
<p>
The quantum oracle we consider is the unitary [mathjaxinline]U[/mathjaxinline] such that [mathjaxinline]U|{x}\rangle |{y}\rangle = |{x}\rangle |{y\oplus f(x)}\rangle[/mathjaxinline]. The circuit for the Simon's algorithm is described above. Let us call the upper [mathjaxinline]n[/mathjaxinline] qubits [mathjaxinline]A[/mathjaxinline] and lower [mathjaxinline]n[/mathjaxinline] qubits [mathjaxinline]B[/mathjaxinline]. </p>
<p>
The procedure of the Simon's algorithm is the following. </p>
<ol class="enumerate">
<li value="1">
<p>
Get the measurement result in [mathjaxinline]A[/mathjaxinline]. Store the result as [mathjaxinline]z_1[/mathjaxinline]. </p>
</li>
<li value="2">
<p>
Repeat the above step [mathjaxinline]n-1[/mathjaxinline] times and store those results as [mathjaxinline]z_2,z_3,\dots z_{n-1}[/mathjaxinline]. </p>
</li>
<li value="3">
<p>
Solve [mathjaxinline]z_ i \cdot s =0, \ i=1,2,\dots , n-1[/mathjaxinline] for [mathjaxinline]s[/mathjaxinline] where [mathjaxinline]\cdot[/mathjaxinline] is an inner product modulo 2, i.e. [mathjaxinline]x \cdot y = x_1 y_1 \oplus \dots x_ n y_ n[/mathjaxinline]. </p>
</li>
<li value="4">
<p>
If there exists unique solution for [mathjaxinline]s\neq 0^ n[/mathjaxinline], check if [mathjaxinline]f(s) = f(0^ n)[/mathjaxinline]. If it is satisfied, we conclude it is the [mathjaxinline]s[/mathjaxinline] we are looking for. If it is not satisfied, we conclude [mathjaxinline]s = 0^ n[/mathjaxinline]. If there is no unique solution ([mathjaxinline]n-1[/mathjaxinline] equations are not independent), the algorithm is abolished and start from the beginning. </p>
</li>
</ol>
<p>
In this problem, we are going to get our hands on to work out specific examples with [mathjaxinline]n=2[/mathjaxinline] so that one can get an idea what is going on. </p>
<p>
Suppose [mathjaxinline]f(x)=\sigma (x)[/mathjaxinline] where [mathjaxinline]\sigma[/mathjaxinline] is the permutation such that </p>
<table id="a0000000005" class="equation" width="100%" cellspacing="0" cellpadding="7" style="table-layout:auto">
<tr>
<td class="equation" style="width:80%; border:none">[mathjax]\pi = \begin{pmatrix} 00 &amp; 01 &amp; 10 &amp; 11 \\ 01 &amp; 10 &amp; 11 &amp; 00 \end{pmatrix}[/mathjax]</td>
<td class="eqnnum" style="width:20%; border:none;text-align:right">(1.2)</td>
</tr>
</table>
<p>
which maps [mathjaxinline]00\rightarrow 01[/mathjaxinline], [mathjaxinline]01\rightarrow 10[/mathjaxinline] etc. </p>
<ul class="itemize">
<li>
<p>
Suppose we get the result 00 for the measurement in [mathjaxinline]B[/mathjaxinline]. What is the 2-qubit state [mathjaxinline]A[/mathjaxinline] right before the measurement in [mathjaxinline]A[/mathjaxinline]? Answer with the ket notation taking the global phase so that the coefficients are real. </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="inputtype_Simons_algorithm_I_2_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Simons_algorithm_I_2_1" id="input_Simons_algorithm_I_2_1" aria-describedby="status_Simons_algorithm_I_2_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Simons_algorithm_I_2_1"/>
<span class="status unanswered" id="status_Simons_algorithm_I_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Simons_algorithm_I_2_1" class="answer"/>
<div id="display_Simons_algorithm_I_2_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Simons_algorithm_I_2_1_dynamath" name="input_Simons_algorithm_I_2_1_dynamath"/>
</div>
</div></div>
</p>
</li>
<li>
<p>
Suppose we ran this algorithm and obtained [mathjaxinline]z_1=01[/mathjaxinline] for the measurement in [mathjaxinline]A[/mathjaxinline]. What [mathjaxinline]s[/mathjaxinline] is obtained by solving [mathjaxinline]z_1 \cdot s =0[/mathjaxinline] other than the trivial solution [mathjaxinline]s = 00[/mathjaxinline]? </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 2" role="group"><div id="inputtype_Simons_algorithm_I_3_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Simons_algorithm_I_3_1" id="input_Simons_algorithm_I_3_1" aria-describedby="status_Simons_algorithm_I_3_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Simons_algorithm_I_3_1"/>
<span class="status unanswered" id="status_Simons_algorithm_I_3_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Simons_algorithm_I_3_1" class="answer"/>
<div id="display_Simons_algorithm_I_3_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Simons_algorithm_I_3_1_dynamath" name="input_Simons_algorithm_I_3_1_dynamath"/>
</div>
</div></div>
</p>
</li>
<li>
<p>
Check whether this [mathjaxinline]s[/mathjaxinline] gives [mathjaxinline]f(s) = f(00)[/mathjaxinline] and conclude the true value [mathjaxinline]s[/mathjaxinline]. </p>
<p>
<p style="display:inline">[mathjaxinline]s=[/mathjaxinline]</p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 3" role="group"><div id="inputtype_Simons_algorithm_I_4_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Simons_algorithm_I_4_1" id="input_Simons_algorithm_I_4_1" aria-describedby="status_Simons_algorithm_I_4_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Simons_algorithm_I_4_1"/>
<span class="status unanswered" id="status_Simons_algorithm_I_4_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Simons_algorithm_I_4_1" class="answer"/>
<div id="display_Simons_algorithm_I_4_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Simons_algorithm_I_4_1_dynamath" name="input_Simons_algorithm_I_4_1_dynamath"/>
</div>
</div></div>
</p>
</li>
</ul>
<p>
<div class="solution-span">
<span id="solution_Simons_algorithm_I_solution_1"/>
</div></p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Simon&#39;s algorithm I" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_Simons_algorithm_I" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_Simons_algorithm_I">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Simons_algorithm_I-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Simons_algorithm_I-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Simons_algorithm_I-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box1xx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box1xx" data-request-token="5efd5e471eda11f097b012192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="html">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-init="VerticalStudentView" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@vertical+block@Simons_algorithm__2_of_2_" data-request-token="5efd5e471eda11f097b012192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="vertical">
<h2 class="hd hd-2 unit-title">Simon's algorithm (2 of 2)</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Simons_algorithm_II">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Simons_algorithm_II" data-request-token="5efd5e471eda11f097b012192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="problem">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_Simons_algorithm_II" class="problems-wrapper" role="group"
aria-labelledby="Simons_algorithm_II-problem-title"
data-problem-id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Simons_algorithm_II" data-url="/courses/course-v1:MITx+8.370.2x+1T2018/xblock/block-v1:MITx+8.370.2x+1T2018+type@problem+block@Simons_algorithm_II/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="5"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="Simons_algorithm_II-problem-title" aria-describedby="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Simons_algorithm_II-problem-progress" tabindex="-1">
Simon&#39;s algorithm II
</h3>
<div class="problem-progress" id="block-v1:MITx+8.370.2x+1T2018+type@problem+block@Simons_algorithm_II-problem-progress"></div>
<div class="problem">
<div>
<p>
Continuing in the scenario of Simon's algorithm problem part I: </p>
<div class="figure" id="fig2">
<center>
<img src="/assets/courseware/v1/fbf484cab02a02017edae9ba8d55ea53/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/images_ps3b_simon.png" width="400" style="scale:0.7"/>
</center>
</div>
<p>
Suppose [mathjaxinline]f(x)=x'[/mathjaxinline] where [mathjaxinline]x'[/mathjaxinline] is the string with 0 for the first bit and having the same bits for the rest. For instance, [mathjaxinline]f(11)=01[/mathjaxinline] and [mathjaxinline]f(00)=00[/mathjaxinline]. </p>
<ul class="itemize">
<li>
<p>
Suppose we get the result 00 for the measurement in [mathjaxinline]B[/mathjaxinline]. What is the 2-qubit state [mathjaxinline]A[/mathjaxinline] right before the measurement in [mathjaxinline]A[/mathjaxinline]? Answer with the ket notation taking the global phase so that the coefficients are real. </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div id="inputtype_Simons_algorithm_II_2_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Simons_algorithm_II_2_1" id="input_Simons_algorithm_II_2_1" aria-describedby="status_Simons_algorithm_II_2_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Simons_algorithm_II_2_1"/>
<span class="status unanswered" id="status_Simons_algorithm_II_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Simons_algorithm_II_2_1" class="answer"/>
<div id="display_Simons_algorithm_II_2_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Simons_algorithm_II_2_1_dynamath" name="input_Simons_algorithm_II_2_1_dynamath"/>
</div>
</div></div>
</p>
</li>
<li>
<p>
In the above case, what are the two possible measurement results for the measurement in [mathjaxinline]A[/mathjaxinline]? </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 2" role="group"><div id="inputtype_Simons_algorithm_II_3_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Simons_algorithm_II_3_1" id="input_Simons_algorithm_II_3_1" aria-describedby="status_Simons_algorithm_II_3_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Simons_algorithm_II_3_1"/>
<span class="status unanswered" id="status_Simons_algorithm_II_3_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Simons_algorithm_II_3_1" class="answer"/>
<div id="display_Simons_algorithm_II_3_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Simons_algorithm_II_3_1_dynamath" name="input_Simons_algorithm_II_3_1_dynamath"/>
</div>
</div></div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 3" role="group"><div id="inputtype_Simons_algorithm_II_4_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Simons_algorithm_II_4_1" id="input_Simons_algorithm_II_4_1" aria-describedby="status_Simons_algorithm_II_4_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Simons_algorithm_II_4_1"/>
<span class="status unanswered" id="status_Simons_algorithm_II_4_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Simons_algorithm_II_4_1" class="answer"/>
<div id="display_Simons_algorithm_II_4_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Simons_algorithm_II_4_1_dynamath" name="input_Simons_algorithm_II_4_1_dynamath"/>
</div>
</div></div>
</p>
</li>
<li>
<p>
Suppose we ran this algorithm and obtained [mathjaxinline]z_1[/mathjaxinline] such that [mathjaxinline]z \neq 00[/mathjaxinline] for the measurement in [mathjaxinline]A[/mathjaxinline]. What [mathjaxinline]s[/mathjaxinline] is obtained by solving [mathjaxinline]z_1 \cdot s =0[/mathjaxinline] other than the trivial solution [mathjaxinline]s = 00[/mathjaxinline]? </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 4" role="group"><div id="inputtype_Simons_algorithm_II_5_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Simons_algorithm_II_5_1" id="input_Simons_algorithm_II_5_1" aria-describedby="status_Simons_algorithm_II_5_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Simons_algorithm_II_5_1"/>
<span class="status unanswered" id="status_Simons_algorithm_II_5_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Simons_algorithm_II_5_1" class="answer"/>
<div id="display_Simons_algorithm_II_5_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Simons_algorithm_II_5_1_dynamath" name="input_Simons_algorithm_II_5_1_dynamath"/>
</div>
</div></div>
</p>
</li>
<li>
<p>
Check whether this [mathjaxinline]s[/mathjaxinline] gives [mathjaxinline]f(s) = f(00)[/mathjaxinline] and conclude the true value [mathjaxinline]s[/mathjaxinline]. </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 5" role="group"><div id="inputtype_Simons_algorithm_II_6_1" class="text-input-dynamath capa_inputtype textline">
<div class="text-input-dynamath_data " data-preprocessor="MathjaxPreprocessorForQM"/>
<div class="script_placeholder" data-src="/assets/courseware/v1/95fe583d41f010195cf50c9f61992d94/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/mathjax_preprocessor_for_QM_H.js"/>
<div class="unanswered ">
<input type="text" name="input_Simons_algorithm_II_6_1" id="input_Simons_algorithm_II_6_1" aria-describedby="status_Simons_algorithm_II_6_1" value="" class="math"/>
<span class="trailing_text" id="trailing_text_Simons_algorithm_II_6_1"/>
<span class="status unanswered" id="status_Simons_algorithm_II_6_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
<p id="answer_Simons_algorithm_II_6_1" class="answer"/>
<div id="display_Simons_algorithm_II_6_1" class="equation">`{::}`</div>
<textarea style="display:none" id="input_Simons_algorithm_II_6_1_dynamath" name="input_Simons_algorithm_II_6_1_dynamath"/>
</div>
</div></div>
</p>
</li>
</ul>
<p>
<div class="solution-span">
<span id="solution_Simons_algorithm_II_solution_1"/>
</div></p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Simon&#39;s algorithm II" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_Simons_algorithm_II" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_Simons_algorithm_II">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Simons_algorithm_II-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Simons_algorithm_II-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="Simons_algorithm_II-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box1xxx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-init="XBlockToXModuleShim" data-usage-id="block-v1:MITx+8.370.2x+1T2018+type@html+block@html_site_search_box1xxx" data-request-token="5efd5e471eda11f097b012192c274abf" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.370.2x+1T2018" data-runtime-class="LmsRuntime" data-block-type="html">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.370.2x+1T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.370.2x+1T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.370.2x+1T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
© All Rights Reserved